comparison toys/pending/dhcp.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
comparison
equal deleted inserted replaced
1040:7dfad5f21984 1041:d3f9e55e350a
368 */ 368 */
369 static void write_pid(char *path) 369 static void write_pid(char *path)
370 { 370 {
371 int pidfile = open(path, O_CREAT | O_WRONLY | O_TRUNC, 0666); 371 int pidfile = open(path, O_CREAT | O_WRONLY | O_TRUNC, 0666);
372 if (pidfile > 0) { 372 if (pidfile > 0) {
373 char *pidbuf = utoa(getpid()); 373 char pidbuf[12];
374
375 sprintf(pidbuf, "%u", (unsigned)getpid());
374 write(pidfile, pidbuf, strlen(pidbuf)); 376 write(pidfile, pidbuf, strlen(pidbuf));
375 close(pidfile); 377 close(pidfile);
376 } 378 }
377 } 379 }
378 380