diff --git a/top/top.c b/top/top.c index 004d2428..d51d5aa5 100644 --- a/top/top.c +++ b/top/top.c @@ -3260,6 +3260,11 @@ error Hey, fix the above fscanf 'PFLAGSSIZ' dependency ! if (3 > fscanf(fp, "\twinflags=%d, sortindx=%d, maxtasks=%d, graph_cpus=%d, graph_mems=%d\n" , &w->rc.winflags, &w->rc.sortindx, &w->rc.maxtasks, &w->rc.graph_cpus, &w->rc.graph_mems)) return p; + if (w->rc.graph_cpus < 0 || w->rc.graph_cpus > 2) + return p; + if (w->rc.graph_mems < 0 || w->rc.graph_mems > 2) + return p; + if (4 != fscanf(fp, "\tsummclr=%d, msgsclr=%d, headclr=%d, taskclr=%d\n" , &w->rc.summclr, &w->rc.msgsclr , &w->rc.headclr, &w->rc.taskclr)) @@ -3299,6 +3304,10 @@ error Hey, fix the above fscanf 'PFLAGSSIZ' dependency ! ; // avoid -Wunused-result if (Rc.fixed_widest < -1 || Rc.fixed_widest > SCREENMAX) Rc.fixed_widest = 0; + if (Rc.summ_mscale < 0 || Rc.summ_mscale > SK_Eb) + Rc.summ_mscale = 0; + if (Rc.task_mscale < 0 || Rc.task_mscale > SK_Pb) + Rc.task_mscale = 0; // we'll start off Inspect stuff with 1 'potential' blank line // ( only realized if we end up with Inspect.total > 0 ) @@ -5127,7 +5136,7 @@ numa_nope: } if (w->rc.graph_mems) { - static struct { + static const struct { const char *used, *misc, *swap, *type; } gtab[] = { { "%-.*s~7", "%-.*s~8", "%-.*s~8", Graph_bars },