vmstat: getopt*() returns -1 when done, not EOF.
Luckily, EOF is usually -1, but this is not guaranteed by the standard.
This commit is contained in:
parent
2503ec3630
commit
4ce81d4dcc
2
vmstat.c
2
vmstat.c
@ -878,7 +878,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
while ((c =
|
while ((c =
|
||||||
getopt_long(argc, argv, "afmnsdDp:S:wthV", longopts,
|
getopt_long(argc, argv, "afmnsdDp:S:wthV", longopts,
|
||||||
NULL)) != EOF)
|
NULL)) != -1)
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'V':
|
case 'V':
|
||||||
printf(PROCPS_NG_VERSION);
|
printf(PROCPS_NG_VERSION);
|
||||||
|
Loading…
Reference in New Issue
Block a user