diff Meerwald/gen_kund3_sig.c @ 8:f83ef905a63d

fixing many warnings increase capacity for coordinates in bruyn fix some uninit. variables
author Peter Meerwald <pmeerw@cosy.sbg.ac.at>
date Tue, 22 Apr 2008 13:36:05 +0200
parents 2b350281f8b0
children ad1d224896c5
line wrap: on
line diff
--- a/Meerwald/gen_kund3_sig.c	Wed Apr 16 15:55:52 2008 +0200
+++ b/Meerwald/gen_kund3_sig.c	Tue Apr 22 13:36:05 2008 +0200
@@ -122,13 +122,14 @@
     exit(1);
   }
 
-  if (argc == 1 && *argv[0] != '-')
-  if ((in = fopen(argv[0], "rb")) == NULL) {
-    fprintf(stderr, "%s: unable to open input file %s\n", progname, argv[0]);
-    exit(1);
+  if (argc == 1 && *argv[0] != '-') {
+    if ((in = fopen(argv[0], "rb")) == NULL) {
+      fprintf(stderr, "%s: unable to open input file %s\n", progname, argv[0]);
+      exit(1);
+    }
+    else
+      strcpy(input_name, argv[0]);
   }
-  else
-    strcpy(input_name, argv[0]);
 
   if (sig) {
     char line[32];
@@ -163,7 +164,7 @@
       fprintf(stderr, "%s: invalid signature file %s\n", progname, signature_name);
       exit(1);
     }
-    close(sig);
+    fclose(sig);
   }
 
   if (s)
@@ -195,7 +196,7 @@
   fprintf(out, "%d\n", f);
   fprintf(out, "%s\n", F);
   fprintf(out, "%d\n", l);
-  fprintf(out, "%d\n", random());
+  fprintf(out, "%ld\n", random());
   nbit_signature = NBYTESTOBITS(n_signature);
   binstr = malloc((nbit_signature + 1) * sizeof(char));
   sig_to_binstr(binstr);

Repositories maintained by Peter Meerwald, pmeerw@pmeerw.net.