Bläddra i källkod

* Ported [2773] to 1.2.10
* Fixed cmd_trace not displaying hops correctly.


svn: 2774

Bryan Drewery 20 år sedan
förälder
incheckning
eaf7850f50
2 ändrade filer med 8 tillägg och 9 borttagningar
  1. 1 0
      doc/UPDATES
  2. 7 9
      src/botcmd.c

+ 1 - 0
doc/UPDATES

@@ -20,6 +20,7 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 * Fixed a potential dns socket leak. (might fix #230)
 * Fixed leaf bots sending color to hub bots still. (fixes #161)
 * Fixed cmd_trace to use 2 decimal places in display for seconds. (fixes #207)
+* Fixed cmd_trace not displaying hops correctly.
 
 1.2.9
 * Fixed cmd_[un]stick not properly using numbers for channel masks. (#160)

+ 7 - 9
src/botcmd.c

@@ -746,18 +746,16 @@ static void bot_traced(int idx, char *par)
           ((sock == (-1)) || (sock == dcc[i].sock))) {
 	if (t) {
           int j=0;
-          {
-            register char *c=p;
-            for (; *c != '\0'; c++) if (*c == ':') j++;
-          }
+          register char *c = p2;
+          for (; *c != '\0'; c++) if (*c == ':') j++;
 
-         time_t tm;
-         egg_timeval_t tv;
+          time_t tm;
+          egg_timeval_t tv;
 
-         timer_get_now(&tv);
-         tm = ((tv.sec % 10000) * 100 + (tv.usec * 100) / (1000000)) - t;
+          timer_get_now(&tv);
+          tm = ((tv.sec % 10000) * 100 + (tv.usec * 100) / (1000000)) - t;
 
-         dprintf(i, "%s -> %s (%li.%li secs, %d hop%s)\n", BOT_TRACERESULT, p2,
+          dprintf(i, "%s -> %s (%li.%li secs, %d hop%s)\n", BOT_TRACERESULT, p2,
             (tm / 100), (tm % 100), j, (j != 1) ? "s" : "");
 	} else
 	  dprintf(i, "%s -> %s\n", BOT_TRACERESULT, p);