comparison Meerwald/gen_xie_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 be303a3f5ea8
children ad1d224896c5
comparison
equal deleted inserted replaced
7:2b350281f8b0 8:f83ef905a63d
118 if (argc > 1) { 118 if (argc > 1) {
119 usage(); 119 usage();
120 exit(1); 120 exit(1);
121 } 121 }
122 122
123 if (argc == 1 && *argv[0] != '-') 123 if (argc == 1 && *argv[0] != '-') {
124 if ((in = fopen(argv[0], "rb")) == NULL) { 124 if ((in = fopen(argv[0], "rb")) == NULL) {
125 fprintf(stderr, "%s: unable to open input file %s\n", progname, argv[0]); 125 fprintf(stderr, "%s: unable to open input file %s\n", progname, argv[0]);
126 exit(1); 126 exit(1);
127 } 127 }
128 else 128 else
129 strcpy(input_name, argv[0]); 129 strcpy(input_name, argv[0]);
130 }
130 131
131 if (sig) { 132 if (sig) {
132 char line[32]; 133 char line[32];
133 fgets(line, sizeof(line), sig); 134 fgets(line, sizeof(line), sig);
134 if (strspn(line, "XESG") >= 4) { 135 if (strspn(line, "XESG") >= 4) {
159 } 160 }
160 else { 161 else {
161 fprintf(stderr, "%s: invalid signature file %s\n", progname, signature_name); 162 fprintf(stderr, "%s: invalid signature file %s\n", progname, signature_name);
162 exit(1); 163 exit(1);
163 } 164 }
164 close(sig); 165 fclose(sig);
165 } 166 }
166 167
167 if (s) 168 if (s)
168 srandom(s); 169 srandom(s);
169 else 170 else
191 fprintf(out, "%f\n", a); 192 fprintf(out, "%f\n", a);
192 fprintf(out, "%d\n", e); 193 fprintf(out, "%d\n", e);
193 fprintf(out, "%d\n", f); 194 fprintf(out, "%d\n", f);
194 fprintf(out, "%s\n", F); 195 fprintf(out, "%s\n", F);
195 fprintf(out, "%d\n", l); 196 fprintf(out, "%d\n", l);
196 fprintf(out, "%d\n", random()); 197 fprintf(out, "%ld\n", random());
197 fwrite(signature, sizeof(char), nb, out); 198 fwrite(signature, sizeof(char), nb, out);
198 fprintf(out, "\n"); 199 fprintf(out, "\n");
199 200
200 fclose(out); 201 fclose(out);
201 202

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