procps-ng/vmstat-getopt-returns-1-when-done-not-EOF.patch
2019-12-25 17:13:31 +08:00

27 lines
714 B
Diff

From 4ce81d4dccbf74bc20e049b08cf4fc712168fdf4 Mon Sep 17 00:00:00 2001
From: Qualys Security Advisory <qsa@qualys.com>
Date: Thu, 1 Jan 1970 00:00:00 +0000
Subject: [PATCH 14/65] vmstat: getopt*() returns -1 when done, not EOF.
Luckily, EOF is usually -1, but this is not guaranteed by the standard.
---
vmstat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/vmstat.c b/vmstat.c
index f2aa2f4..6eca2c4 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);
--
2.6.4.windows.1