git @ Cat's Eye Technologies Befunge-93 / 606e0d5
When an error occurs, exit program with non-zero exit code. Chris Pressey 4 years ago
1 changed file(s) with 7 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
5858 v1.0: circa Jun 2018
5959 handle trampoline at leftmost/topmost edges
6060 (thanks to https://github.com/serprex for this fix!)
61 exit with non-zero error code on error
6162
6263 v0.94: Sep 2004, Chris Pressey
6364 cleanup only, no functional changes
167168 if ((pg == NULL) || (pgbuf == NULL))
168169 {
169170 printf ("Error: can't allocate %d bytes of memory.\n", LINEWIDTH * PAGEHEIGHT);
170 exit(0);
171 exit (1);
171172 }
172173 memset(pg, ' ', LINEWIDTH * PAGEHEIGHT);
173174 memset(pgbuf, ' ', LINEWIDTH * PAGEHEIGHT);
178179 if (prof[i] == NULL)
179180 {
180181 printf ("Error: can't allocate %lu bytes of memory.\n", (long)(LINEWIDTH * PAGEHEIGHT * sizeof(long int)));
181 exit(0);
182 exit (1);
182183 }
183184 memset(prof[i], 0, LINEWIDTH * PAGEHEIGHT * sizeof(long int));
184185 }
186187 if (argc < 2)
187188 {
188189 printf ("USAGE: befprof [-l] [-q] [-i] [-n count] [-r input] [-w foo.map] foo.bf\n");
189 exit (0);
190 exit (1);
190191 }
191192
192193 strcpy(filename, argv[argc - 1]);
243244 } else
244245 {
245246 printf ("Error: couldn't open '%s' for input.\n", filename);
246 exit (0);
247 exit (1);
247248 }
248249
249250 if (!(fp = fopen (mapfilename, "w")))
250251 {
251252 printf ("Error : couldn't open '%s' for output.\n", mapfilename);
252 exit (0);
253 exit (1);
253254 }
254255
255256 while (rep <= reps)
268269 if (!(fi = fopen (argv[ia], "r")))
269270 {
270271 printf ("Error : couldn't open '%s' for input.\n", argv[ia]);
271 exit (0);
272 exit (1);
272273 }
273274 }
274275