diff --git a/ChangeLog b/ChangeLog index ee8166df..a1db8d1a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-04-28 Nicolas François + + * libmisc/rlogin.c: Replace atoi() by getulong(). + 2009-04-28 Nicolas François * libmisc/failure.c: Replace HAVE_UTMPX_H by USE_UTMPX. diff --git a/libmisc/rlogin.c b/libmisc/rlogin.c index 2217c220..b4fd82f0 100644 --- a/libmisc/rlogin.c +++ b/libmisc/rlogin.c @@ -133,7 +133,7 @@ do_rlogin (const char *remote_host, char *name, size_t namelen, char *term, struct passwd *pwd; char remote_name[32]; char *cp; - int remote_speed = 9600; + unsigned long remote_speed = 9600; int speed_name = B9600; int i; TERMIO termio; @@ -147,8 +147,7 @@ do_rlogin (const char *remote_host, char *name, size_t namelen, char *term, *cp = '\0'; cp++; - remote_speed = atoi (cp); - if (0 == remote_speed) { + if (getulong (cp, &remote_speed) == 0) { remote_speed = 9600; } }