aboutsummaryrefslogtreecommitdiff
path: root/toys/pending/syslogd.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2013-09-03 08:30:47 -0500
committerRob Landley <rob@landley.net>2013-09-03 08:30:47 -0500
commitf538f420deffc242742ce2d0661a39fa9a3b5399 (patch)
tree25841579cf96612ab0f81e6d4738ac5da89ef7c4 /toys/pending/syslogd.c
parent79d8bc70539b7a3d459630c97e38d3cdff77e591 (diff)
downloadtoybox-f538f420deffc242742ce2d0661a39fa9a3b5399.tar.gz
Remove itoa/utoa, let libc do this with sprintf.
Diffstat (limited to 'toys/pending/syslogd.c')
-rw-r--r--toys/pending/syslogd.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/toys/pending/syslogd.c b/toys/pending/syslogd.c
index 31389191..c2cc34a1 100644
--- a/toys/pending/syslogd.c
+++ b/toys/pending/syslogd.c
@@ -84,11 +84,13 @@ int logger_lookup(int where, char *key)
}
//search the given name and return its value
-static char *dec(int val, CODE *clist)
+static char *dec(int val, CODE *clist, char *buf)
{
for (; clist->c_name; clist++)
if (val == clist->c_val) return clist->c_name;
- return itoa(val);
+ sprintf(buf, "%u", val);
+
+ return buf;
}
/*
@@ -340,8 +342,10 @@ static void logmsg(char *msg, int len)
if (toys.optflags & FLAG_K) len = sprintf(toybuf, "<%d> %s\n", pri, msg);
else {
- facstr = dec(pri & LOG_FACMASK, facilitynames);
- lvlstr = dec(LOG_PRI(pri), prioritynames);
+ char facbuf[12], pribuf[12];
+
+ facstr = dec(pri & LOG_FACMASK, facilitynames, facbuf);
+ lvlstr = dec(LOG_PRI(pri), prioritynames, pribuf);
p = "local";
if (!uname(&uts)) p = uts.nodename;