Added all of the MH sources, including RCS files, in
[mmh] / docs / historical / mh-6.8.5 / sbr / RCS / m_atoi.c,v
1 head    1.2;
2 access;
3 symbols;
4 locks; strict;
5 comment @ * @;
6
7
8 1.2
9 date    92.10.26.22.52.05;      author jromine; state Exp;
10 branches;
11 next    1.1;
12
13 1.1
14 date    92.10.26.22.51.37;      author jromine; state Exp;
15 branches;
16 next    ;
17
18
19 desc
20 @@
21
22
23 1.2
24 log
25 @LOCALE
26 @
27 text
28 @/* m_atoi.c - parse a string representation of a message number */
29 #ifndef lint
30 static char ident[] = "@@(#)$Id: gans.c,v 1.2 1992/10/26 22:50:52 jromine Exp $";
31 #endif /* lint */
32
33 #include "../h/mh.h"
34
35
36 m_atoi (str)
37 register char *str;
38 {
39     register int    i;
40     register char  *cp;
41
42     i = 0;
43     cp = str;
44 #ifdef LOCALE
45     while (isdigit(*cp)) {
46         i *= 10;
47         i += *cp++ - '0';
48     }
49 #else
50     while (*cp) {
51         if (*cp < '0' || *cp > '9')
52             return 0;
53         i *= 10;
54         i += *cp++ - '0';
55     }
56 #endif
57
58     return i;
59 }
60 @
61
62
63 1.1
64 log
65 @Initial revision
66 @
67 text
68 @d2 3
69 d17 6
70 d29 1
71 @