comparison Meerwald/gen_xie2_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 acb6967ee76d
children ad1d224896c5
comparison
equal deleted inserted replaced
7:2b350281f8b0 8:f83ef905a63d
123 if (argc > 1) { 123 if (argc > 1) {
124 usage(); 124 usage();
125 exit(1); 125 exit(1);
126 } 126 }
127 127
128 if (argc == 1 && *argv[0] != '-') 128 if (argc == 1 && *argv[0] != '-') {
129 if ((in = fopen(argv[0], "rb")) == NULL) { 129 if ((in = fopen(argv[0], "rb")) == NULL) {
130 fprintf(stderr, "%s: unable to open input file %s\n", progname, argv[0]); 130 fprintf(stderr, "%s: unable to open input file %s\n", progname, argv[0]);
131 exit(1); 131 exit(1);
132 } 132 }
133 else 133 else
134 strcpy(input_name, argv[0]); 134 strcpy(input_name, argv[0]);
135 135 }
136
136 if (sig) { 137 if (sig) {
137 char line[32]; 138 char line[32];
138 fgets(line, sizeof(line), sig); 139 fgets(line, sizeof(line), sig);
139 if (strspn(line, "XE2SG") >= 5) { 140 if (strspn(line, "XE2SG") >= 5) {
140 if (n == 0) 141 if (n == 0)
168 } 169 }
169 else { 170 else {
170 fprintf(stderr, "%s: invalid signature file %s\n", progname, signature_name); 171 fprintf(stderr, "%s: invalid signature file %s\n", progname, signature_name);
171 exit(1); 172 exit(1);
172 } 173 }
173 close(sig); 174 fclose(sig);
174 } 175 }
175 176
176 if (s) 177 if (s)
177 srandom(s); 178 srandom(s);
178 else 179 else
201 fprintf(out, "%d\n", e); 202 fprintf(out, "%d\n", e);
202 fprintf(out, "%d\n", f); 203 fprintf(out, "%d\n", f);
203 fprintf(out, "%s\n", F); 204 fprintf(out, "%s\n", F);
204 fprintf(out, "%d\n", q); 205 fprintf(out, "%d\n", q);
205 fprintf(out, "%d\n", l); 206 fprintf(out, "%d\n", l);
206 fprintf(out, "%d\n", random()); 207 fprintf(out, "%ld\n", random());
207 fwrite(signature, sizeof(char), nb, out); 208 fwrite(signature, sizeof(char), nb, out);
208 fprintf(out, "\n"); 209 fprintf(out, "\n");
209 210
210 fclose(out); 211 fclose(out);
211 212

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