Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144572444
D49614.1775523295.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D49614.1775523295.diff
View Options
diff --git a/bin/ps/ps.c b/bin/ps/ps.c
--- a/bin/ps/ps.c
+++ b/bin/ps/ps.c
@@ -147,16 +147,16 @@
static void pidmax_init(void);
static void usage(void);
-static char dfmt[] = "pid,tt,state,time,command";
-static char jfmt[] = "user,pid,ppid,pgid,sid,jobc,state,tt,time,command";
-static char lfmt[] = "uid,pid,ppid,cpu,pri,nice,vsz,rss,mwchan,state,"
- "tt,time,command";
-static char o1[] = "pid";
-static char o2[] = "tt,state,time,command";
-static char ufmt[] = "user,pid,%cpu,%mem,vsz,rss,tt,state,start,time,command";
-static char vfmt[] = "pid,state,time,sl,re,pagein,vsz,rss,lim,tsiz,"
- "%cpu,%mem,command";
-static char Zfmt[] = "label";
+static const char dfmt[] = "pid,tt,state,time,command";
+static const char jfmt[] = "user,pid,ppid,pgid,sid,jobc,state,tt,time,command";
+static const char lfmt[] = "uid,pid,ppid,cpu,pri,nice,vsz,rss,mwchan,state,"
+ "tt,time,command";
+static const char o1[] = "pid";
+static const char o2[] = "tt,state,time,command";
+static const char ufmt[] = "user,pid,%cpu,%mem,vsz,rss,tt,state,start,time,command";
+static const char vfmt[] = "pid,state,time,sl,re,pagein,vsz,rss,lim,tsiz,"
+ "%cpu,%mem,command";
+static const char Zfmt[] = "label";
#define PS_ARGS "AaCcD:defG:gHhjJ:LlM:mN:O:o:p:rSTt:U:uvwXxZ"
@@ -316,7 +316,6 @@
case 'j':
parsefmt(jfmt, &varlist, 0);
_fmt = 1;
- jfmt[0] = '\0';
break;
case 'L':
showkey();
@@ -324,7 +323,6 @@
case 'l':
parsefmt(lfmt, &varlist, 0);
_fmt = 1;
- lfmt[0] = '\0';
break;
case 'M':
memf = optarg;
@@ -339,7 +337,6 @@
parsefmt(o1, &varlist, 1);
parsefmt(optarg, &varlist, 1);
parsefmt(o2, &varlist, 1);
- o1[0] = o2[0] = '\0';
_fmt = 1;
break;
case 'o':
@@ -408,13 +405,11 @@
parsefmt(ufmt, &varlist, 0);
sortby = SORTCPU;
_fmt = 1;
- ufmt[0] = '\0';
break;
case 'v':
parsefmt(vfmt, &varlist, 0);
sortby = SORTMEM;
_fmt = 1;
- vfmt[0] = '\0';
break;
case 'w':
if (wflag)
@@ -442,7 +437,6 @@
break;
case 'Z':
parsefmt(Zfmt, &varlist, 0);
- Zfmt[0] = '\0';
break;
case '?':
default:
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Apr 7, 12:54 AM (9 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28283033
Default Alt Text
D49614.1775523295.diff (2 KB)
Attached To
Mode
D49614: ps(1): Constify the format strings for canned displays
Attached
Detach File
Event Timeline
Log In to Comment