diff options
Diffstat (limited to 'riemann.fmi.uni-sofia.bg/programs/nlogin-0.3-pre/scan_ulong.c')
| -rw-r--r-- | riemann.fmi.uni-sofia.bg/programs/nlogin-0.3-pre/scan_ulong.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/riemann.fmi.uni-sofia.bg/programs/nlogin-0.3-pre/scan_ulong.c b/riemann.fmi.uni-sofia.bg/programs/nlogin-0.3-pre/scan_ulong.c new file mode 100644 index 0000000..d2a6896 --- /dev/null +++ b/riemann.fmi.uni-sofia.bg/programs/nlogin-0.3-pre/scan_ulong.c @@ -0,0 +1,8 @@ +unsigned int scan_ulong(register char *s, register unsigned long *u) /*EXTRACT_INCL*/ { + register unsigned int pos; register unsigned long result; + register unsigned long c; + pos = 0; result = 0; + while ((c = (unsigned long) (unsigned char) (s[pos] - '0')) < 10) + { result = result * 10 + c; ++pos; } + *u = result; return pos; +} |
