]> granicus.if.org Git - procps-ng/commitdiff
no C99 variable declarations just yet
authoralbert <>
Wed, 26 Jan 2005 07:55:52 +0000 (07:55 +0000)
committeralbert <>
Wed, 26 Jan 2005 07:55:52 +0000 (07:55 +0000)
top.c

diff --git a/top.c b/top.c
index 65653394b88699fe412e42c8332de21785ae888b..4aa3ac2d75f224d3965c105664439c4047783ce1 100644 (file)
--- a/top.c
+++ b/top.c
@@ -1577,14 +1577,16 @@ static void before (char *me)
       Fieldstab[P_CPN].fmts = " %4u";
    }
 
-   unsigned pid_digits = get_pid_digits();
-   if(pid_digits<4) pid_digits=4;
-   static char pid_fmt[6];
-   snprintf(pid_fmt, sizeof pid_fmt, " %%%uu", pid_digits);
-   Fieldstab[P_PID].fmts = pid_fmt;
-   Fieldstab[P_PID].head = "        PID" + 10 - pid_digits;
-   Fieldstab[P_PPD].fmts = pid_fmt;
-   Fieldstab[P_PPD].head = "       PPID" + 10 - pid_digits;
+   {
+      static char pid_fmt[6];
+      unsigned pid_digits = get_pid_digits();
+      if(pid_digits<4) pid_digits=4;
+      snprintf(pid_fmt, sizeof pid_fmt, " %%%uu", pid_digits);
+      Fieldstab[P_PID].fmts = pid_fmt;
+      Fieldstab[P_PID].head = "        PID" + 10 - pid_digits;
+      Fieldstab[P_PPD].fmts = pid_fmt;
+      Fieldstab[P_PPD].head = "       PPID" + 10 - pid_digits;
+   }
 }