Mercurial > hg > toybox
changeset 1041:d3f9e55e350a draft
Convert dhcp/dhcpd from utoa() to sprintf().
author | Rob Landley <rob@landley.net> |
---|---|
date | Tue, 03 Sep 2013 08:16:42 -0500 |
parents | 7dfad5f21984 |
children | cbc467592b2e |
files | toys/pending/dhcp.c toys/pending/dhcpd.c |
diffstat | 2 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/toys/pending/dhcp.c Mon Sep 02 22:20:29 2013 -0500 +++ b/toys/pending/dhcp.c Tue Sep 03 08:16:42 2013 -0500 @@ -370,7 +370,9 @@ { 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); }
--- a/toys/pending/dhcpd.c Mon Sep 02 22:20:29 2013 -0500 +++ b/toys/pending/dhcpd.c Tue Sep 03 08:16:42 2013 -0500 @@ -310,7 +310,9 @@ { 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); }