diff options
author | Alex Musolino <alex@musolino.id.au> | 2019-06-11 15:19:18 +0930 |
---|---|---|
committer | Alex Musolino <alex@musolino.id.au> | 2019-06-11 15:19:18 +0930 |
commit | d904a57e1763ac884a749b04f19f3e490a4cec88 (patch) | |
tree | 615dc0c6e1f6e4c9e3127c692e0100e983cc0895 | |
parent | 396844787c65f42dc77f65c259dcff39eb63578b (diff) |
snoopy(8): avoid extra spaces in dhcp filter output
-rw-r--r-- | sys/src/cmd/ip/snoopy/dhcp.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/src/cmd/ip/snoopy/dhcp.c b/sys/src/cmd/ip/snoopy/dhcp.c index 005c930d1..9d7d2b7a2 100644 --- a/sys/src/cmd/ip/snoopy/dhcp.c +++ b/sys/src/cmd/ip/snoopy/dhcp.c @@ -65,9 +65,14 @@ puint(char *p, char *e, char *tag, uchar *o, int n) static char* pserver(char *p, char *e, char *tag, uchar *o, int n) { + int i; + p = seprint(p, e, "%s=(", tag); + i = 0; while(n >= 4){ - p = seprint(p, e, " %V", o); + if(i++ > 0) + p = seprint(p, e, " "); + p = seprint(p, e, "%V", o); n -= 4; o += 4; } @@ -345,7 +350,7 @@ p_seprint(Msg *m) case OBend: goto out; default: - snprint(msg, sizeof msg, " T%ud", code); + snprint(msg, sizeof msg, "T%ud", code); p = phex(p, e, msg, o, n); break; } |