Diff for /embedaddon/mtr/ui/curses.c between versions 1.1.1.2 and 1.1.1.3

version 1.1.1.2, 2021/03/17 00:07:30 version 1.1.1.3, 2023/09/27 11:18:58
Line 3 Line 3
     Copyright (C) 1997,1998  Matt Kimball      Copyright (C) 1997,1998  Matt Kimball
   
     This program is free software; you can redistribute it and/or modify      This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License version 2 as     it under the terms of the GNU General Public License version 2 as
     published by the Free Software Foundation.      published by the Free Software Foundation.
   
     This program is distributed in the hope that it will be useful,      This program is distributed in the hope that it will be useful,
Line 390  static void format_field( Line 390  static void format_field(
         format_number(n, 5, dst);          format_number(n, 5, dst);
     } else if (strchr(format, 'f')) {      } else if (strchr(format, 'f')) {
         /* this is for fields where we measure integer microseconds but          /* this is for fields where we measure integer microseconds but
           display floating point miliseconds. Convert to float here. */           display floating point milliseconds. Convert to float here. */
         snprintf(dst, dst_length, format, n / 1000.0);          snprintf(dst, dst_length, format, n / 1000.0);
         /* this was marked as a temporary hack over 10 years ago. -- REW */          /* this was marked as a temporary hack over 10 years ago. -- REW */
     } else {      } else {
Line 432  static void mtr_curses_hosts( Line 432  static void mtr_curses_hosts(
                 attron(A_BOLD);                  attron(A_BOLD);
 #ifdef HAVE_IPINFO  #ifdef HAVE_IPINFO
             if (is_printii(ctl))              if (is_printii(ctl))
                printw(fmt_ipinfo(ctl, addr));                printw("%s", fmt_ipinfo(ctl, addr));
 #endif  #endif
             if (name != NULL) {              if (name != NULL) {
                 if (ctl->show_ips)                  if (ctl->show_ips)
                    printw("%s (%s)", name, strlongip(ctl, addr));                    printw("%s (%s)", name, strlongip(ctl->af, addr));
                 else                  else
                     printw("%s", name);                      printw("%s", name);
             } else {              } else {
                printw("%s", strlongip(ctl, addr));                printw("%s", strlongip(ctl->af, addr));
             }              }
             attroff(A_BOLD);              attroff(A_BOLD);
   
Line 451  static void mtr_curses_hosts( Line 451  static void mtr_curses_hosts(
             hd_len = 0;              hd_len = 0;
             for (i = 0; i < MAXFLD; i++) {              for (i = 0; i < MAXFLD; i++) {
                 /* Ignore options that don't exist */                  /* Ignore options that don't exist */
                /* On the other hand, we now check the input side. Shouldn't happen,                 /* On the other hand, we now check the input side. Shouldn't happen,
                    can't be careful enough. */                     can't be careful enough. */
                 j = ctl->fld_index[ctl->fld_active[i]];                  j = ctl->fld_index[ctl->fld_active[i]];
                 if (j == -1)                  if (j == -1)
Line 485  static void mtr_curses_hosts( Line 485  static void mtr_curses_hosts(
                 printw("\n    ");                  printw("\n    ");
 #ifdef HAVE_IPINFO  #ifdef HAVE_IPINFO
                 if (is_printii(ctl))                  if (is_printii(ctl))
                    printw(fmt_ipinfo(ctl, addrs));                    printw("%s", fmt_ipinfo(ctl, addrs));
 #endif  #endif
                 if (name != NULL) {                  if (name != NULL) {
                     if (ctl->show_ips)                      if (ctl->show_ips)
                        printw("%s (%s)", name, strlongip(ctl, addrs));                        printw("%s (%s)", name, strlongip(ctl->af, addrs));
                     else                      else
                         printw("%s", name);                          printw("%s", name);
                 } else {                  } else {
                    printw("%s", strlongip(ctl, addrs));                    printw("%s", strlongip(ctl->af, addrs));
                 }                  }
                 for (k = 0; k < mplss->labels && ctl->enablempls; k++) {                  for (k = 0; k < mplss->labels && ctl->enablempls; k++) {
                     printw("\n    [MPLS: Lbl %lu TC %u S %u TTL %u]",                      printw("\n    [MPLS: Lbl %lu TC %u S %u TTL %u]",
Line 650  static void mtr_curses_graph( Line 650  static void mtr_curses_graph(
   
 #ifdef HAVE_IPINFO  #ifdef HAVE_IPINFO
             if (is_printii(ctl))              if (is_printii(ctl))
                printw(fmt_ipinfo(ctl, addr));                printw("%s", fmt_ipinfo(ctl, addr));
 #endif  #endif
             name = dns_lookup(ctl, addr);              name = dns_lookup(ctl, addr);
            printw("%s", name ? name : strlongip(ctl, addr));            printw("%s", name ? name : strlongip(ctl->af, addr));
         } else {          } else {
             attron(A_BOLD);              attron(A_BOLD);
             printw("(%s)", host_error_to_string(err));              printw("(%s)", host_error_to_string(err));
Line 698  void mtr_curses_redraw( Line 698  void mtr_curses_redraw(
     pwcenter(buf);      pwcenter(buf);
     attroff(A_BOLD);      attroff(A_BOLD);
   
    mvprintw(1, 0, "%s (%s) -> %s", ctl->LocalHostname, net_localaddr(), ctl->Hostname);    mvprintw(1, 0, "%s (%s) -> %s (%s)",
         ctl->LocalHostname, net_localaddr(),
         ctl->Hostname, net_remoteaddr());
     t = time(NULL);      t = time(NULL);
    mvprintw(1, maxx - 25, iso_time(&t));    mvprintw(1, maxx - 25, "%s", iso_time(&t));
     printw("\n");      printw("\n");
   
     printw("Keys:  ");      printw("Keys:  ");
Line 760  void mtr_curses_redraw( Line 762  void mtr_curses_redraw(
         startstat = padding - 2;          startstat = padding - 2;
   
         snprintf(msg, sizeof(msg), " Last %3d pings", max_cols);          snprintf(msg, sizeof(msg), " Last %3d pings", max_cols);
        mvprintw(rowstat - 1, startstat, msg);        mvprintw(rowstat - 1, startstat, "%s", msg);
   
         attroff(A_BOLD);          attroff(A_BOLD);
         move(rowstat, 0);          move(rowstat, 0);

Removed from v.1.1.1.2  
changed lines
  Added in v.1.1.1.3


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>