]> granicus.if.org Git - procps-ng/blobdiff - top/top.c
top: harden detailed stats two abreast summary display <=== port of newlib e5386f1f
[procps-ng] / top / top.c
index 08e1c8051545ffb464bdc7d65669fe5163a8ce83..92fff6d6ea1995a1cf1048a242ebc6383df13098 100644 (file)
--- a/top/top.c
+++ b/top/top.c
@@ -5860,6 +5860,9 @@ static void keys_summary (int ch) {
          if ((w->rc.double_up >= ADJOIN_limit)
          || ((w->rc.double_up >= smp_num_cpus)))
             w->rc.double_up = 0;
+         if ((w->rc.double_up > 1)
+         && (!w->rc.graph_cpus))
+            w->rc.double_up = 0;
          OFFw(w, (View_CPUSUM | View_CPUNOD));
          break;
       case 'C':
@@ -5883,6 +5886,9 @@ static void keys_summary (int ch) {
             w->rc.graph_cpus = 0;
             OFFw(w, View_STATES);
          }
+         if ((w->rc.double_up > 1)
+         && (!w->rc.graph_cpus))
+            w->rc.double_up = 0;
          break;
       default:                    // keep gcc happy
          break;