mirror of
git://git.9front.org/plan9front/plan9front
synced 2025-01-12 11:10:06 +00:00
ip/ipconfig: don't use sprint() when we have variable strings.
This commit is contained in:
parent
eb76dc48cd
commit
c7fd84937c
2 changed files with 5 additions and 5 deletions
|
@ -603,9 +603,9 @@ openlisten(void)
|
|||
|
||||
if (validip(conf.laddr) &&
|
||||
(conf.state == Srenewing || conf.state == Srebinding))
|
||||
sprint(data, "%s/udp!%I!68", conf.mpoint, conf.laddr);
|
||||
snprint(data, sizeof(data), "%s/udp!%I!68", conf.mpoint, conf.laddr);
|
||||
else
|
||||
sprint(data, "%s/udp!*!68", conf.mpoint);
|
||||
snprint(data, sizeof(data), "%s/udp!*!68", conf.mpoint);
|
||||
for (n = 0; (cfd = announce(data, devdir)) < 0; n++) {
|
||||
if(!noconfig)
|
||||
sysfatal("can't announce for dhcp: %r");
|
||||
|
@ -622,7 +622,7 @@ openlisten(void)
|
|||
|
||||
fprint(cfd, "ignoreadvice");
|
||||
|
||||
sprint(data, "%s/data", devdir);
|
||||
snprint(data, sizeof(data), "%s/data", devdir);
|
||||
fd = open(data, ORDWR);
|
||||
if(fd < 0)
|
||||
sysfatal("open %s: %r", data);
|
||||
|
|
|
@ -37,7 +37,7 @@ openlisten(void)
|
|||
int n, fd, cfd;
|
||||
char data[128], devdir[40];
|
||||
|
||||
sprint(data, "%s/udp!%I!546", conf.mpoint, conf.lladdr);
|
||||
snprint(data, sizeof(data), "%s/udp!%I!546", conf.mpoint, conf.lladdr);
|
||||
for (n = 0; (cfd = announce(data, devdir)) < 0; n++) {
|
||||
if(!noconfig)
|
||||
sysfatal("can't announce for dhcp: %r");
|
||||
|
@ -54,7 +54,7 @@ openlisten(void)
|
|||
|
||||
fprint(cfd, "ignoreadvice");
|
||||
|
||||
sprint(data, "%s/data", devdir);
|
||||
snprint(data, sizeof(data), "%s/data", devdir);
|
||||
fd = open(data, ORDWR);
|
||||
if(fd < 0)
|
||||
sysfatal("open %s: %r", data);
|
||||
|
|
Loading…
Reference in a new issue