[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r9233: Spec-conformance on r9181: make "opt v" strings start with " (in tor/trunk: . src/or)



Author: nickm
Date: 2007-01-02 01:13:10 -0500 (Tue, 02 Jan 2007)
New Revision: 9233

Modified:
   tor/trunk/
   tor/trunk/src/or/dirserv.c
Log:
 r11784@Kushana:  nickm | 2007-01-02 01:13:04 -0500
 Spec-conformance on r9181: make "opt v" strings start with "Tor".



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r11784] on c95137ef-5f19-0410-b913-86e773d04f59

Modified: tor/trunk/src/or/dirserv.c
===================================================================
--- tor/trunk/src/or/dirserv.c	2007-01-02 02:01:15 UTC (rev 9232)
+++ tor/trunk/src/or/dirserv.c	2007-01-02 06:13:10 UTC (rev 9233)
@@ -1563,14 +1563,16 @@
       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);
       }
     }
   });