r11784@Kushana: nickm | 2007-01-02 01:13:04 -0500

Spec-conformance on r9181: make "opt v" strings start with "Tor".


svn:r9233
This commit is contained in:
Nick Mathewson
2007-01-02 06:13:10 +00:00
parent 6ae3ba9b2d
commit 722a3ab544
+9 -7
View File
@@ -1563,14 +1563,16 @@ generate_v2_networkstatus(void)
outp += strlen(outp);
if (ri->platform && !strcmpstart(ri->platform, "Tor ")) {
const char *eos = find_whitespace(ri->platform+4);
char *platform = tor_strndup(ri->platform+4, eos-(ri->platform+4));
if (tor_snprintf(outp, endp-outp,
"opt v %s\n", platform)<0) {
log_warn(LD_BUG, "Unable to print router version.");
goto done;
if (eos) {
char *platform = tor_strndup(ri->platform, eos-(ri->platform));
if (tor_snprintf(outp, endp-outp,
"opt v %s\n", platform)<0) {
log_warn(LD_BUG, "Unable to print router version.");
goto done;
}
tor_free(platform);
outp += strlen(outp);
}
tor_free(platform);
outp += strlen(outp);
}
}
});