summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/lib/inputint.c
blob: 3082c8a112f7141cda87d77015f312ba8a57cec8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* inputint.c: read integers from text files.  These routines are only
   used for debugging and such, so perfect error checking isn't
   necessary.  Public domain. */

#include "config.h"
#include "lib.h"

/* Read an integer from the file F, reading past the subsequent end of
   line.  */

integer
inputint P1C(FILE *, f)
{
  char buffer[MAX_INT_LENGTH]; /* Long enough for anything reasonable.  */

  return
    fgets (buffer, sizeof (buffer), f)
    ? atoi (buffer)
    : 0;
}