4ec18c3e70
to cast "void*" to one or the other.
19 lines
611 B
Text
19 lines
611 B
Text
$NetBSD: patch-an,v 1.1 2002/02/27 21:37:41 martin Exp $
|
|
|
|
--- getlopt.c.orig Tue Dec 8 10:41:11 1998
|
|
+++ getlopt.c Wed Feb 27 22:29:57 2002
|
|
@@ -45,10 +45,12 @@
|
|
|
|
if (!(opt->flags & 1)) { /* doesn't take argument */
|
|
if (opt->var) {
|
|
- if (opt->flags & 2) /* var is *char */
|
|
+ if (opt->flags & GLO_CHAR) /* var is *char */
|
|
*((char *) opt->var) = (char) opt->value;
|
|
- else
|
|
+ else if (opt->flags & GLO_LONG) /* var is *long */
|
|
*((long *) opt->var) = opt->value;
|
|
+ else /* var is *int */
|
|
+ *((int *) opt->var) = opt->value;
|
|
}
|
|
else
|
|
result = opt->value ? opt->value : opt->sname;
|