Adjust detected pageheight, allowing eg/fact2.bf to compile OK.
Chris Pressey
3 years ago
64 | 64 | show usage and exit if unrecognized command-line |
65 | 65 | options are given |
66 | 66 | exit with a non-zero exit code if an error occurs |
67 | when detecing pageheight, add one on the assumption | |
68 | that the source does not end with a newline | |
69 | (this lets some existing example programs compile) | |
67 | 70 | |
68 | 71 | v0.94: Sep 2004, Chris Pressey |
69 | 72 | display correct version number |
205 | 208 | exit (1); |
206 | 209 | } |
207 | 210 | |
211 | /* Most Befunge-93 sources do not end with a newline. Therefore: */ | |
212 | if (pageheight < 25) pageheight++; | |
213 | ||
208 | 214 | if (!(fo = fopen (argv[argc - 1], "w"))) /*** Output */ |
209 | 215 | { |
210 | 216 | printf ("Error : couldn't open '%s' for output.\n", argv[argc - 1]); |
211 | 217 | exit (1); |
212 | 218 | } |
213 | 219 | |
220 | printf ("Loaded %d columns by %d rows.\n", linewidth, pageheight); | |
214 | 221 | printf ("Compiling"); |
215 | 222 | |
216 | 223 | fprintf (fo, "/* %s converted to ANSI C from %s by bef2c */\n", |