beta-0.89.2
[luatex.git] / source / texk / web2c / lib / inputint.c
blobd27bb6a148c83fd16d29867256195d6a0ecae121
1 /* inputint.c: read integers from text files. These routines are only
2 used for debugging and such, so perfect error checking isn't
3 necessary. Public domain. */
5 #include <w2c/config.h>
6 #include "lib.h"
8 /* Read an integer from the file F, reading past the subsequent end of
9 line. */
11 integer
12 inputint (FILE *f)
14 char buffer[MAX_INT_LENGTH]; /* Long enough for anything reasonable. */
16 return
17 fgets (buffer, sizeof (buffer), f)
18 ? atoi (buffer)
19 : 0;