Fix all incorrect getopt_long() return value usages.
parent
15e00fcf6c
commit
c7a53338c0
|
@ -35,6 +35,7 @@ xx/xx/2006 - 1.13.1-WIP
|
||||||
- libntfs: add ntfs_str2ucs(), ntfs_freeucs(), ntfs_mft_usn_dec()
|
- libntfs: add ntfs_str2ucs(), ntfs_freeucs(), ntfs_mft_usn_dec()
|
||||||
and ntfs_inode_badclus_bad() functions, and convert all copy-pastes
|
and ntfs_inode_badclus_bad() functions, and convert all copy-pastes
|
||||||
to use them. (Szaka)
|
to use them. (Szaka)
|
||||||
|
- Fix all incorrect getopt_long() return value usages. (Szaka)
|
||||||
|
|
||||||
27/02/2006 - 1.13.0 - Lots and lots and lots of fixes and enhancements.
|
27/02/2006 - 1.13.0 - Lots and lots and lots of fixes and enhancements.
|
||||||
|
|
||||||
|
|
|
@ -372,7 +372,7 @@ static BOOL mkntfs_parse_options(int argc, char *argv[], struct mkntfs_options *
|
||||||
{ NULL, 0, NULL, 0 }
|
{ NULL, 0, NULL, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
char c = -1;
|
int c = -1;
|
||||||
int lic = 0;
|
int lic = 0;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
int ver = 0;
|
int ver = 0;
|
||||||
|
@ -384,7 +384,7 @@ static BOOL mkntfs_parse_options(int argc, char *argv[], struct mkntfs_options *
|
||||||
|
|
||||||
opterr = 0; /* We'll handle the errors, thank you. */
|
opterr = 0; /* We'll handle the errors, thank you. */
|
||||||
|
|
||||||
while ((c = getopt_long(argc, argv, sopt, lopt, NULL)) != (char)-1) {
|
while ((c = getopt_long(argc, argv, sopt, lopt, NULL)) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 1: /* A device, or a number of sectors */
|
case 1: /* A device, or a number of sectors */
|
||||||
if (!opts2->dev_name)
|
if (!opts2->dev_name)
|
||||||
|
|
|
@ -169,7 +169,7 @@ static int parse_options(int argc, char **argv)
|
||||||
{ NULL, 0, NULL, 0 }
|
{ NULL, 0, NULL, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
char c = -1;
|
int c = -1;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
int ver = 0;
|
int ver = 0;
|
||||||
int help = 0;
|
int help = 0;
|
||||||
|
@ -183,7 +183,7 @@ static int parse_options(int argc, char **argv)
|
||||||
opts.attr_name = NULL;
|
opts.attr_name = NULL;
|
||||||
opts.attr_name_len = 0;
|
opts.attr_name_len = 0;
|
||||||
|
|
||||||
while ((c = getopt_long(argc, argv, sopt, lopt, NULL)) != (char)-1) {
|
while ((c = getopt_long(argc, argv, sopt, lopt, NULL)) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 1: /* A non-option argument */
|
case 1: /* A non-option argument */
|
||||||
if (!opts.device) {
|
if (!opts.device) {
|
||||||
|
|
|
@ -297,11 +297,11 @@ static void parse_options(int argc, char **argv)
|
||||||
{ NULL, 0, NULL, 0 }
|
{ NULL, 0, NULL, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
char c;
|
int c;
|
||||||
|
|
||||||
memset(&opt, 0, sizeof(opt));
|
memset(&opt, 0, sizeof(opt));
|
||||||
|
|
||||||
while ((c = getopt_long(argc, argv, sopt, lopt, NULL)) != (char)-1) {
|
while ((c = getopt_long(argc, argv, sopt, lopt, NULL)) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 1: /* A non-option argument */
|
case 1: /* A non-option argument */
|
||||||
if (opt.volume)
|
if (opt.volume)
|
||||||
|
|
|
@ -127,7 +127,7 @@ static int parse_options(int argc, char **argv)
|
||||||
{ NULL, 0, NULL, 0 }
|
{ NULL, 0, NULL, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
char c = -1;
|
int c = -1;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
int ver = 0;
|
int ver = 0;
|
||||||
int help = 0;
|
int help = 0;
|
||||||
|
@ -140,7 +140,7 @@ static int parse_options(int argc, char **argv)
|
||||||
opts.range_begin = -1;
|
opts.range_begin = -1;
|
||||||
opts.range_end = -1;
|
opts.range_end = -1;
|
||||||
|
|
||||||
while ((c = getopt_long(argc, argv, sopt, lopt, NULL)) != (char)-1) {
|
while ((c = getopt_long(argc, argv, sopt, lopt, NULL)) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 1: /* A non-option argument */
|
case 1: /* A non-option argument */
|
||||||
if (!opts.device) {
|
if (!opts.device) {
|
||||||
|
|
|
@ -177,12 +177,12 @@ static void parse_options(int argc, char **argv)
|
||||||
{ NULL, 0, NULL, 0 }
|
{ NULL, 0, NULL, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
char c;
|
int c;
|
||||||
|
|
||||||
memset(&opt, 0, sizeof(opt));
|
memset(&opt, 0, sizeof(opt));
|
||||||
opt.show_progress = 1;
|
opt.show_progress = 1;
|
||||||
|
|
||||||
while ((c = getopt_long(argc, argv, sopt, lopt, NULL)) != (char)-1) {
|
while ((c = getopt_long(argc, argv, sopt, lopt, NULL)) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 1: /* A non-option argument */
|
case 1: /* A non-option argument */
|
||||||
if (!opt.vol1) {
|
if (!opt.vol1) {
|
||||||
|
|
|
@ -134,7 +134,7 @@ static int parse_options(int argc, char **argv)
|
||||||
};
|
};
|
||||||
|
|
||||||
char *s;
|
char *s;
|
||||||
char c = -1;
|
int c = -1;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
int ver = 0;
|
int ver = 0;
|
||||||
int help = 0;
|
int help = 0;
|
||||||
|
@ -150,7 +150,7 @@ static int parse_options(int argc, char **argv)
|
||||||
|
|
||||||
opterr = 0; /* We'll handle the errors, thank you. */
|
opterr = 0; /* We'll handle the errors, thank you. */
|
||||||
|
|
||||||
while ((c = getopt_long(argc, argv, sopt, lopt, NULL)) != (char) -1) {
|
while ((c = getopt_long(argc, argv, sopt, lopt, NULL)) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 1: /* A non-option argument */
|
case 1: /* A non-option argument */
|
||||||
if (!opts.device) {
|
if (!opts.device) {
|
||||||
|
|
|
@ -195,7 +195,7 @@ static int parse_options(int argc, char **argv)
|
||||||
{NULL, 0, NULL, 0}
|
{NULL, 0, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
char c = -1;
|
int c = -1;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
int ver = 0;
|
int ver = 0;
|
||||||
int help = 0;
|
int help = 0;
|
||||||
|
@ -204,7 +204,7 @@ static int parse_options(int argc, char **argv)
|
||||||
|
|
||||||
opts.inode = -1;
|
opts.inode = -1;
|
||||||
|
|
||||||
while ((c = getopt_long(argc, argv, sopt, lopt, NULL)) != (char)-1) {
|
while ((c = getopt_long(argc, argv, sopt, lopt, NULL)) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 1: /* A non-option argument */
|
case 1: /* A non-option argument */
|
||||||
if (!opts.device)
|
if (!opts.device)
|
||||||
|
|
|
@ -130,7 +130,7 @@ static void version(void)
|
||||||
*/
|
*/
|
||||||
static void parse_options(int argc, char **argv)
|
static void parse_options(int argc, char **argv)
|
||||||
{
|
{
|
||||||
char c;
|
int c;
|
||||||
static const char *sopt = "-hV";
|
static const char *sopt = "-hV";
|
||||||
static const struct option lopt[] = {
|
static const struct option lopt[] = {
|
||||||
{ "help", no_argument, NULL, 'h' },
|
{ "help", no_argument, NULL, 'h' },
|
||||||
|
@ -140,7 +140,7 @@ static void parse_options(int argc, char **argv)
|
||||||
|
|
||||||
memset(&opt, 0, sizeof(opt));
|
memset(&opt, 0, sizeof(opt));
|
||||||
|
|
||||||
while ((c = getopt_long(argc, argv, sopt, lopt, NULL)) != (char)-1) {
|
while ((c = getopt_long(argc, argv, sopt, lopt, NULL)) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 1: /* A non-option argument */
|
case 1: /* A non-option argument */
|
||||||
if (!opt.volume)
|
if (!opt.volume)
|
||||||
|
|
|
@ -166,7 +166,7 @@ static int parse_options(int argc, char *argv[])
|
||||||
{ NULL, 0, NULL, 0 }
|
{ NULL, 0, NULL, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
char c = -1;
|
int c = -1;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
int ver = 0;
|
int ver = 0;
|
||||||
int help = 0;
|
int help = 0;
|
||||||
|
@ -177,7 +177,7 @@ static int parse_options(int argc, char *argv[])
|
||||||
opts.inode = -1;
|
opts.inode = -1;
|
||||||
opts.filename = NULL;
|
opts.filename = NULL;
|
||||||
|
|
||||||
while ((c = getopt_long(argc, argv, sopt, lopt, NULL)) != (char)-1) {
|
while ((c = getopt_long(argc, argv, sopt, lopt, NULL)) != -1) {
|
||||||
ntfs_log_trace("optind=%d; c='%c' optarg=\"%s\".\n", optind, c,
|
ntfs_log_trace("optind=%d; c='%c' optarg=\"%s\".\n", optind, c,
|
||||||
optarg);
|
optarg);
|
||||||
switch (c) {
|
switch (c) {
|
||||||
|
|
|
@ -122,7 +122,7 @@ static int parse_options(int argc, char *argv[])
|
||||||
{ NULL, 0, NULL, 0 },
|
{ NULL, 0, NULL, 0 },
|
||||||
};
|
};
|
||||||
|
|
||||||
char c = -1;
|
int c = -1;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
int ver = 0;
|
int ver = 0;
|
||||||
int help = 0;
|
int help = 0;
|
||||||
|
|
|
@ -210,7 +210,7 @@ static int parse_options(int argc, char *argv[])
|
||||||
{ NULL, 0, NULL, 0 },
|
{ NULL, 0, NULL, 0 },
|
||||||
};
|
};
|
||||||
|
|
||||||
char c = -1;
|
int c = -1;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
int ver = 0;
|
int ver = 0;
|
||||||
int help = 0;
|
int help = 0;
|
||||||
|
@ -222,7 +222,7 @@ static int parse_options(int argc, char *argv[])
|
||||||
opts.device = NULL;
|
opts.device = NULL;
|
||||||
opts.path = "/";
|
opts.path = "/";
|
||||||
|
|
||||||
while ((c = getopt_long(argc, argv, sopt, lopt, NULL)) != (char)-1) {
|
while ((c = getopt_long(argc, argv, sopt, lopt, NULL)) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 1:
|
case 1:
|
||||||
if (!opts.device)
|
if (!opts.device)
|
||||||
|
|
|
@ -1675,7 +1675,7 @@ static char *realpath(const char *path, char *resolved_path)
|
||||||
static int parse_options(int argc, char *argv[])
|
static int parse_options(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
int err = 0, help = 0;
|
int err = 0, help = 0;
|
||||||
char c = -1;
|
int c = -1;
|
||||||
|
|
||||||
static const char *sopt = "-o:h?qv";
|
static const char *sopt = "-o:h?qv";
|
||||||
static const struct option lopt[] = {
|
static const struct option lopt[] = {
|
||||||
|
@ -1692,7 +1692,7 @@ static int parse_options(int argc, char *argv[])
|
||||||
opts.options = NULL;
|
opts.options = NULL;
|
||||||
opts.device = NULL;
|
opts.device = NULL;
|
||||||
|
|
||||||
while ((c = getopt_long(argc, argv, sopt, lopt, NULL)) != (char)-1) {
|
while ((c = getopt_long(argc, argv, sopt, lopt, NULL)) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 1: /* A non-option argument */
|
case 1: /* A non-option argument */
|
||||||
if (!opts.device) {
|
if (!opts.device) {
|
||||||
|
|
|
@ -121,7 +121,7 @@ static int parse_options(int argc, char **argv)
|
||||||
{ NULL, 0, NULL, 0 }
|
{ NULL, 0, NULL, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
char c = -1;
|
int c = -1;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
int ver = 0;
|
int ver = 0;
|
||||||
int help = 0;
|
int help = 0;
|
||||||
|
|
|
@ -453,7 +453,7 @@ static int parse_options(int argc, char **argv)
|
||||||
{ NULL, 0, NULL, 0 }
|
{ NULL, 0, NULL, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
char c;
|
int c;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
int ver = 0;
|
int ver = 0;
|
||||||
int help = 0;
|
int help = 0;
|
||||||
|
@ -461,7 +461,7 @@ static int parse_options(int argc, char **argv)
|
||||||
memset(&opt, 0, sizeof(opt));
|
memset(&opt, 0, sizeof(opt));
|
||||||
opt.show_progress = 1;
|
opt.show_progress = 1;
|
||||||
|
|
||||||
while ((c = getopt_long(argc, argv, sopt, lopt, NULL)) != (char)-1) {
|
while ((c = getopt_long(argc, argv, sopt, lopt, NULL)) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 1: /* A non-option argument */
|
case 1: /* A non-option argument */
|
||||||
if (!err && !opt.volume)
|
if (!err && !opt.volume)
|
||||||
|
|
|
@ -126,7 +126,7 @@ static int parse_options(int argc, char **argv)
|
||||||
{ NULL, 0, NULL, 0 }
|
{ NULL, 0, NULL, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
char c = -1;
|
int c = -1;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
int ver = 0;
|
int ver = 0;
|
||||||
int help = 0;
|
int help = 0;
|
||||||
|
|
|
@ -450,7 +450,7 @@ static int parse_options(int argc, char *argv[])
|
||||||
{ NULL, 0, NULL, 0 }
|
{ NULL, 0, NULL, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
char c = -1;
|
int c = -1;
|
||||||
char *end = NULL;
|
char *end = NULL;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
int ver = 0;
|
int ver = 0;
|
||||||
|
@ -463,7 +463,7 @@ static int parse_options(int argc, char *argv[])
|
||||||
opts.uinode = -1;
|
opts.uinode = -1;
|
||||||
opts.percent = -1;
|
opts.percent = -1;
|
||||||
opts.fillbyte = -1;
|
opts.fillbyte = -1;
|
||||||
while ((c = getopt_long(argc, argv, sopt, lopt, NULL)) != (char)-1) {
|
while ((c = getopt_long(argc, argv, sopt, lopt, NULL)) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 1: /* A non-option argument */
|
case 1: /* A non-option argument */
|
||||||
if (!opts.device) {
|
if (!opts.device) {
|
||||||
|
|
|
@ -209,7 +209,7 @@ static int parse_options(int argc, char *argv[])
|
||||||
{ NULL, 0, NULL, 0 }
|
{ NULL, 0, NULL, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
char c = -1;
|
int c = -1;
|
||||||
char *end;
|
char *end;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
int ver = 0;
|
int ver = 0;
|
||||||
|
|
Loading…
Reference in New Issue