projects
/
unix-history
/ blame
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blob
|
blame
(incremental) |
history
|
HEAD
file reorg, pathnames.h, paths.h
[unix-history]
/
usr
/
src
/
usr.bin
/
learn
/
objects
/
getnum.c
Commit
Line
Data
87cbc68f
JK
1
#ifndef lint
2
static char sccsid[] = "@(#)getnum.c 1.1 (Berkeley) %G%";
3
#endif not lint
4
5
#include <stdio.h>
6
7
getnum()
8
{
9
int c, n;
10
11
n = 0;
12
while ((c=getchar()) >= '0' && c <= '9')
13
n = n*10 + c - '0';
14
if (c == EOF)
15
return(-1);
16
return(n);
17
}