mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-10 08:22:27 +01:00
Test getopt() against -1 instead of EOF.
This commit is contained in:
parent
6dc4364cd6
commit
8a9d51c4f8
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=105237
@ -34,7 +34,6 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sysexits.h>
|
#include <sysexits.h>
|
||||||
#include "collate.h"
|
#include "collate.h"
|
||||||
@ -297,9 +296,9 @@ main(int ac, char **av)
|
|||||||
int ch;
|
int ch;
|
||||||
|
|
||||||
#ifdef COLLATE_DEBUG
|
#ifdef COLLATE_DEBUG
|
||||||
while((ch = getopt(ac, av, ":do:I:")) != EOF) {
|
while((ch = getopt(ac, av, ":do:I:")) != -1) {
|
||||||
#else
|
#else
|
||||||
while((ch = getopt(ac, av, ":o:I:")) != EOF) {
|
while((ch = getopt(ac, av, ":o:I:")) != -1) {
|
||||||
#endif
|
#endif
|
||||||
switch (ch)
|
switch (ch)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user