getopt return value has to be held in int, not char.

This commit is contained in:
itojun 2003-09-10 00:03:42 +00:00
parent 61aa48ec24
commit 0186de22d3

View File

@ -1,4 +1,4 @@
.\" $NetBSD: getopt.3,v 1.27 2003/09/09 19:31:53 wiz Exp $
.\" $NetBSD: getopt.3,v 1.28 2003/09/10 00:03:42 itojun Exp $
.\"
.\" Copyright (c) 1988, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@ -242,7 +242,8 @@ It is provided for backward compatibility
The following code fragment works in most cases.
.Bd -literal -offset indent
int length;
char *p,c;
char *p;
int c;
while ((c = getopt(argc, argv, "0123456789")) != -1) {
switch (c) {