summaryrefslogtreecommitdiffstats
path: root/regress/lib/libc/glob
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2011-01-07 19:45:44 +0000
committermillert <millert@openbsd.org>2011-01-07 19:45:44 +0000
commitad5e11da9b2b9e2462715a5708d115880ba06009 (patch)
tree400cb8fc4c3eb733eae40ca064cfe0c3ededbe07 /regress/lib/libc/glob
parentdo not special case ep0 at pci/eisa. ep* will be fine. We should not (diff)
downloadwireguard-openbsd-ad5e11da9b2b9e2462715a5708d115880ba06009.tar.xz
wireguard-openbsd-ad5e11da9b2b9e2462715a5708d115880ba06009.zip
Remove an extraneous return statement with the wrong return value.
Fix some gcc warnings.
Diffstat (limited to 'regress/lib/libc/glob')
-rw-r--r--regress/lib/libc/glob/globtest.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/regress/lib/libc/glob/globtest.c b/regress/lib/libc/glob/globtest.c
index e47a728da81..325a7750f0c 100644
--- a/regress/lib/libc/glob/globtest.c
+++ b/regress/lib/libc/glob/globtest.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: globtest.c,v 1.2 2010/09/24 13:32:55 djm Exp $ */
+/* $OpenBSD: globtest.c,v 1.3 2011/01/07 19:45:44 millert Exp $ */
/*
* Public domain, 2008, Todd C. Miller <Todd.Miller@courtesan.com>
@@ -17,7 +17,7 @@ struct gl_entry {
int nresults;
char pattern[1024];
char *results[MAX_RESULTS];
- long modes[MAX_RESULTS];
+ mode_t modes[MAX_RESULTS];
};
int test_glob(struct gl_entry *);
@@ -26,9 +26,8 @@ int
main(int argc, char **argv)
{
FILE *fp = stdin;
- char *buf, *cp, *want, *got, *last;
- const char *errstr;
- int errors = 0, i, lineno, mode;
+ char *buf, *cp;
+ int errors = 0, lineno, mode;
struct gl_entry entry;
size_t len;
@@ -94,7 +93,7 @@ main(int argc, char **argv)
mode = strtol(cp, NULL, 8);
} else
mode = -1;
- entry.modes[entry.nresults] = mode;
+ entry.modes[entry.nresults] = (mode_t)mode;
entry.results[entry.nresults++] = strdup(buf);
}
if (entry.pattern[0])
@@ -105,7 +104,7 @@ main(int argc, char **argv)
int test_glob(struct gl_entry *entry)
{
glob_t gl;
- int i;
+ int i = 0;
if (glob(entry->pattern, entry->flags, NULL, &gl) != 0)
errx(1, "glob failed: %s", entry->pattern);
@@ -139,6 +138,5 @@ int test_glob(struct gl_entry *entry)
while (i < gl.gl_matchc) {
free(entry->results[i++]);
}
- return (0);
return (1);
}