]> git.lizzy.rs Git - plan9front.git/commitdiff
snoopy(8): avoid extra spaces in dhcp filter output
authorAlex Musolino <alex@musolino.id.au>
Tue, 11 Jun 2019 05:49:18 +0000 (15:19 +0930)
committerAlex Musolino <alex@musolino.id.au>
Tue, 11 Jun 2019 05:49:18 +0000 (15:19 +0930)
sys/src/cmd/ip/snoopy/dhcp.c

index 005c930d1486c1f2b8e2b241f35bca0749e29992..9d7d2b7a23aafd98d753b4b76648e2c749e40035 100644 (file)
@@ -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;
                }