From 79d8bc70539b7a3d459630c97e38d3cdff77e591 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Tue, 3 Sep 2013 08:16:42 -0500 Subject: Convert dhcp/dhcpd from utoa() to sprintf(). --- toys/pending/dhcp.c | 4 +++- toys/pending/dhcpd.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/toys/pending/dhcp.c b/toys/pending/dhcp.c index d7a43fad..0bb4ccdd 100644 --- a/toys/pending/dhcp.c +++ b/toys/pending/dhcp.c @@ -370,7 +370,9 @@ static void write_pid(char *path) { int pidfile = open(path, O_CREAT | O_WRONLY | O_TRUNC, 0666); if (pidfile > 0) { - char *pidbuf = utoa(getpid()); + char pidbuf[12]; + + sprintf(pidbuf, "%u", (unsigned)getpid()); write(pidfile, pidbuf, strlen(pidbuf)); close(pidfile); } diff --git a/toys/pending/dhcpd.c b/toys/pending/dhcpd.c index 18f4f25e..2a54f88c 100644 --- a/toys/pending/dhcpd.c +++ b/toys/pending/dhcpd.c @@ -310,7 +310,9 @@ static void write_pid(char *path) { int pidfile = open(path, O_CREAT | O_WRONLY | O_TRUNC, 0666); if (pidfile > 0) { - char *pidbuf = utoa(getpid()); + char pidbuf[12]; + + sprintf(pidbuf, "%u", (unsigned)getpid()); write(pidfile, pidbuf, strlen(pidbuf)); close(pidfile); } -- cgit v1.2.3