o Correct getopt() argument so that initattr -r and -w take an additional

argument via optarg.  This corrects a segfault when initattr is invoked
  with either of these two arguments.  Not sure how this got broken given
  that in the original patches it was fine -- presumably a merging
  mistake.

Obtained from:	TrustedBSD Project
This commit is contained in:
Robert Watson 2000-07-12 02:20:16 +00:00
parent 9a47755d7c
commit 3b88d2796e

View File

@ -116,7 +116,7 @@ initattr(int argc, char *argv[])
int ch, i, error;
optind = 0;
while ((ch = getopt(argc, argv, "p:rw")) != -1)
while ((ch = getopt(argc, argv, "p:r:w:")) != -1)
switch (ch) {
case 'p':
fs_path = strdup(optarg);