diff toys/pending/dhcpd.c @ 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 03f72b57a092
children e11684e3bbc5
line wrap: on
line diff
--- 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);
   }