From 6547cbda6fb58f76c30906f26b9a99ae1348f81c Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Tue, 28 Apr 2009 19:17:21 +0000 Subject: [PATCH] * libmisc/rlogin.c: Replace atoi() by getulong(). --- ChangeLog | 4 ++++ libmisc/rlogin.c | 5 ++--- 2 files changed, 6 insertions(+), 3 deletions(-) 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; } }