Replace atoi() with atonum() --> better error handling.

Friends don't let friends use atoi().

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2015-02-25 10:12:15 +01:00
1 parent ccdab464c3
commit 2adec264af
2 files changed
+31 -5

No files matched your search

+4 -2
View File
@@ -29,11 +29,11 @@
#include <syslog.h>
#define DO_LOG(level, fmt, args...) \
{ \
do { \
openlog("finit", LOG_CONS | LOG_PID, LOG_DAEMON); \
syslog(level, fmt, ##args); \
closelog(); \
}
} while (0)
#define FLOG_DEBUG(fmt, args...) DO_LOG(LOG_DEBUG, fmt, ##args)
#define FLOG_INFO(fmt, args...) DO_LOG(LOG_INFO, fmt, ##args)
@@ -94,6 +94,8 @@ extern int verbose;
int makepath (char *path);
void ifconfig (char *ifname, char *addr, char *mask, int up);
int atonum (char *str);
pid_t pidfile_read (char *pidfile);
pid_t pidfile_poll (char *cmd, char *path);