mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-01 11:32:48 -05:00
Fixes (mostly from Colin Watson, a couple redone by me) to make Unix
PuTTY compile cleanly under gcc 4.6.0 without triggering any of its new warnings. [originally from svn r9169]
This commit is contained in:
46
cmdgen.c
46
cmdgen.c
@ -316,25 +316,47 @@ int main(int argc, char **argv)
|
||||
*p++ = '\0';
|
||||
val = p;
|
||||
} else
|
||||
val = NULL;
|
||||
val = NULL;
|
||||
|
||||
if (!strcmp(opt, "-help")) {
|
||||
help();
|
||||
nogo = TRUE;
|
||||
if (val) {
|
||||
errs = TRUE;
|
||||
fprintf(stderr, "puttygen: option `-%s'"
|
||||
" expects no argument\n", opt);
|
||||
} else {
|
||||
help();
|
||||
nogo = TRUE;
|
||||
}
|
||||
} else if (!strcmp(opt, "-version")) {
|
||||
showversion();
|
||||
nogo = TRUE;
|
||||
if (val) {
|
||||
errs = TRUE;
|
||||
fprintf(stderr, "puttygen: option `-%s'"
|
||||
" expects no argument\n", opt);
|
||||
} else {
|
||||
showversion();
|
||||
nogo = TRUE;
|
||||
}
|
||||
} else if (!strcmp(opt, "-pgpfp")) {
|
||||
/* support "-pgpfp" for consistency with others */
|
||||
pgp_fingerprints();
|
||||
nogo = TRUE;
|
||||
if (val) {
|
||||
errs = TRUE;
|
||||
fprintf(stderr, "puttygen: option `-%s'"
|
||||
" expects no argument\n", opt);
|
||||
} else {
|
||||
/* support --pgpfp for consistency */
|
||||
pgp_fingerprints();
|
||||
nogo = TRUE;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* A sample option requiring an argument:
|
||||
* For long options requiring an argument, add
|
||||
* code along the lines of
|
||||
*
|
||||
* else if (!strcmp(opt, "-output")) {
|
||||
* if (!val)
|
||||
* errs = TRUE, error(err_optnoarg, opt);
|
||||
* else
|
||||
* if (!val) {
|
||||
* errs = TRUE;
|
||||
* fprintf(stderr, "puttygen: option `-%s'"
|
||||
* " expects an argument\n", opt);
|
||||
* } else
|
||||
* ofile = val;
|
||||
* }
|
||||
*/
|
||||
|
Reference in New Issue
Block a user