mtr/mtr-xml-format-fixes.patch

40 lines
1.4 KiB
Diff
Raw Normal View History

diff -up mtr-0.83/report.c.orig mtr-0.83/report.c
--- mtr-0.83/report.c.orig 2013-02-18 15:46:33.000000000 +0100
+++ mtr-0.83/report.c 2013-02-18 15:51:38.263294586 +0100
@@ -212,19 +212,19 @@ void xml_close(void)
ip_t *addr;
char name[81];
- printf("<MTR SRC=%s DST=%s", LocalHostname, Hostname);
- printf(" TOS=0x%X", tos);
+ printf("<MTR SRC=\"%s\" DST=\"%s\"", LocalHostname, Hostname);
+ printf(" TOS=\"0x%X\"", tos);
if(cpacketsize >= 0) {
- printf(" PSIZE=%d", cpacketsize);
+ printf(" PSIZE=\"%d\"", cpacketsize);
} else {
- printf(" PSIZE=rand(%d-%d)",MINPACKET, -cpacketsize);
+ printf(" PSIZE=\"rand(%d-%d)\"",MINPACKET, -cpacketsize);
}
if( bitpattern>=0 ) {
- printf(" BITPATTERN=0x%02X", (unsigned char)(bitpattern));
+ printf(" BITPATTERN=\"0x%02X\"", (unsigned char)(bitpattern));
} else {
- printf(" BITPATTERN=rand(0x00-FF)");
+ printf(" BITPATTERN=\"rand(0x00-FF)\"");
}
- printf(" TESTS=%d>\n", MaxPing);
+ printf(" TESTS=\"%d\">\n", MaxPing);
max = net_max();
at = net_min();
@@ -232,7 +232,7 @@ void xml_close(void)
addr = net_addr(at);
snprint_addr(name, sizeof(name), addr);
- printf(" <HUB COUNT=%d HOST=%s>\n", at+1, name);
+ printf(" <HUB COUNT=\"%d\" HOST=\"%s\">\n", at+1, name);
for( i=0; i<MAXFLD; i++ ) {
j = fld_index[fld_active[i]];
if (j <= 0) continue;