aboutsummaryrefslogtreecommitdiff
path: root/loginutils
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-03-06 22:11:45 +0000
committerEric Andersen <andersen@codepoet.org>2004-03-06 22:11:45 +0000
commit2479445562a9b5a9f226d0b00c41dbd533e63213 (patch)
treee4891420283c085d688683a41cc217dc896917b8 /loginutils
parentc4db0833a6c91dd3714bec1db076a80910af6e30 (diff)
downloadbusybox-w32-2479445562a9b5a9f226d0b00c41dbd533e63213.tar.gz
busybox-w32-2479445562a9b5a9f226d0b00c41dbd533e63213.tar.bz2
busybox-w32-2479445562a9b5a9f226d0b00c41dbd533e63213.zip
Fix/eliminate use of atol
Diffstat (limited to 'loginutils')
-rw-r--r--loginutils/getty.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/loginutils/getty.c b/loginutils/getty.c
index 4219ff821..b12b88fb1 100644
--- a/loginutils/getty.c
+++ b/loginutils/getty.c
@@ -955,22 +955,15 @@ static int caps_lock(const char *s)
955/* bcode - convert speed string to speed code; return 0 on failure */ 955/* bcode - convert speed string to speed code; return 0 on failure */
956static int bcode(const char *s) 956static int bcode(const char *s)
957{ 957{
958#if 0
959 struct Speedtab *sp;
960 long speed = atol(s);
961
962 for (sp = speedtab; sp->speed; sp++)
963 if (sp->speed == speed)
964 return (sp->code);
965 return (0);
966#else
967 int r; 958 int r;
968 959 unsigned long value;
969 if ((r = bb_value_to_baud(atol(s))) > 0) { 960 if (safe_strtoul(s, &value)) {
961 return -1;
962 }
963 if ((r = bb_value_to_baud(value)) > 0) {
970 return r; 964 return r;
971 } 965 }
972 return 0; 966 return 0;
973#endif
974} 967}
975 968
976/* error - report errors to console or syslog; only understands %s and %m */ 969/* error - report errors to console or syslog; only understands %s and %m */