From: Qualys Security Advisory Date: Thu, 1 Jan 1970 00:00:00 +0000 (+0000) Subject: vmstat: getopt*() returns -1 when done, not EOF. X-Git-Tag: v3.3.16~73 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4ce81d4dccbf74bc20e049b08cf4fc712168fdf4;p=procps-ng vmstat: getopt*() returns -1 when done, not EOF. Luckily, EOF is usually -1, but this is not guaranteed by the standard. --- diff --git a/vmstat.c b/vmstat.c index f2aa2f46..6eca2c45 100644 --- a/vmstat.c +++ b/vmstat.c @@ -878,7 +878,7 @@ int main(int argc, char *argv[]) while ((c = getopt_long(argc, argv, "afmnsdDp:S:wthV", longopts, - NULL)) != EOF) + NULL)) != -1) switch (c) { case 'V': printf(PROCPS_NG_VERSION);