aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorJohan Karlsson <johan@FreeBSD.org>2002-08-18 18:21:18 +0000
committerJohan Karlsson <johan@FreeBSD.org>2002-08-18 18:21:18 +0000
commitad23c583180ae290bdfdf121707c1b6b9bca1095 (patch)
tree8564a25b8be7350487211e8847f46bac5a4d3bbc /usr.bin
parent92fd9018694de239d195757ff471a2eb70efbfee (diff)
Notes
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/whereis/whereis.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/usr.bin/whereis/whereis.c b/usr.bin/whereis/whereis.c
index e78e089afebf8..58ca04a64d769 100644
--- a/usr.bin/whereis/whereis.c
+++ b/usr.bin/whereis/whereis.c
@@ -114,20 +114,16 @@ scanopts(int argc, char **argv)
dirlist = &sourcedirs;
dolist:
i = 0;
+ *dirlist = realloc(*dirlist, (i + 1) * sizeof(char *));
+ (*dirlist)[i] = NULL;
while (optind < argc &&
strcmp(argv[optind], "-f") != 0 &&
strcmp(argv[optind], "-B") != 0 &&
strcmp(argv[optind], "-M") != 0 &&
strcmp(argv[optind], "-S") != 0) {
- *dirlist = realloc(*dirlist,
- (i + 2) * sizeof(char *));
- if (*dirlist == NULL)
- abort();
- (*dirlist)[i] = argv[optind];
- i++;
+ decolonify(argv[optind], dirlist, &i);
optind++;
}
- (*dirlist)[i] = NULL;
break;
case 'b':