+ {
+ float msec = delta(then, &now) / 1000.0;
+
+ if (times_p)
+ {
+ if (new->desc) free (new->desc);
+ new->desc = (char *) malloc (30);
+ if (msec > 99) sprintf (new->desc, " %.0f ms ", msec);
+ else if (msec > 9) sprintf (new->desc, " %.1f ms ", msec);
+ else if (msec > 1) sprintf (new->desc, " %.2f ms ", msec);
+ else sprintf (new->desc, " %.3f ms ", msec);
+ }
+
+ if (debug_p && times_p) /* print ping-like stuff to stdout */
+ {
+ struct sockaddr_in *iaddr = (struct sockaddr_in *) &from;
+ unsigned int a, b, c, d;
+ char ipstr[20];
+ char *s = strdup (new->desc);
+ char *s2 = s, *s3 = s;
+ while (*s2 == ' ') s2++;
+ s3 = strchr (s2, ' ');
+ if (s3) *s3 = 0;
+
+ unpack_addr (iaddr->sin_addr.s_addr, &a, &b, &c, &d);
+ sprintf (ipstr, "%d.%d.%d.%d", a, b, c, d);
+
+ fprintf (stdout,
+ "%3d bytes from %28s: "
+ "icmp_seq=%-4d ttl=%d time=%s ms\n",
+ result,
+ name,
+ /*ipstr,*/
+ ICMP_SEQ(icmph), si->TTL, s2);
+ free (s);
+ }
+
+ /* Don't put anyone *too* close to the center of the screen. */
+ msec += 0.6;