]> granicus.if.org Git - procps-ng/commitdiff
%3s and %31s
authoralbert <>
Sat, 7 Dec 2002 00:39:05 +0000 (00:39 +0000)
committeralbert <>
Sat, 7 Dec 2002 00:39:05 +0000 (00:39 +0000)
top.c

diff --git a/top.c b/top.c
index fab1d0e54b632d535e097968d7fbde74b00184cd..bd6e9a3ff8a29db1bdde70cfd5e111d68d031bb7 100644 (file)
--- a/top.c
+++ b/top.c
@@ -1219,7 +1219,7 @@ static int rc_read_new (const char *const buf, RCF_t *rc) {
 
    for (i = 0; i < GROUPSMAX; i++) {
       RCW_t *ptr = &rc->win[i];
-      cnt = sscanf(cp, "%s\tfieldscur=%s\n", ptr->winname, ptr->fieldscur);
+      cnt = sscanf(cp, "%3s\tfieldscur=%31s\n", ptr->winname, ptr->fieldscur);
       if (cnt != 2) return 5+100*i;  // OK to have less than 4 windows
       if (WINNAMSIZ <= strlen(ptr->winname)) return -6;
       if (strlen(DEF_FIELDS) != strlen(ptr->fieldscur)) return -7;