diff options
Diffstat (limited to 'Build')
-rw-r--r-- | Build/source/texk/ps2pk/ChangeLog | 4 | ||||
-rw-r--r-- | Build/source/texk/ps2pk/mag.c | 2 | ||||
-rw-r--r-- | Build/source/texk/ps2pk/pk2bm.c | 5 |
3 files changed, 11 insertions, 0 deletions
diff --git a/Build/source/texk/ps2pk/ChangeLog b/Build/source/texk/ps2pk/ChangeLog index c01adf53cd3..09eebc9b8bf 100644 --- a/Build/source/texk/ps2pk/ChangeLog +++ b/Build/source/texk/ps2pk/ChangeLog @@ -1,3 +1,7 @@ +2018-12-05 Hironobu Yamashita <h.y.acetaminophen@gmail.com> + + * mag.c, pk2bm.c: check for missing arguments. + 2018-12-01 Hironobu Yamashita <h.y.acetaminophen@gmail.com> * ps2pk.c: check for missing arguments. diff --git a/Build/source/texk/ps2pk/mag.c b/Build/source/texk/ps2pk/mag.c index 96857286987..3f5c6b61d57 100644 --- a/Build/source/texk/ps2pk/mag.c +++ b/Build/source/texk/ps2pk/mag.c @@ -104,9 +104,11 @@ int main(int argc, char *argv[]) { if (*++argv[0] == '\0') { argc--; argv++; } + if (argv[0] == '\0') goto invalid; DPI = atof(argv[0]); done = 1; break; +invalid: default: fatal("%s: %c invalid option\n", myname, c); } diff --git a/Build/source/texk/ps2pk/pk2bm.c b/Build/source/texk/ps2pk/pk2bm.c index 39303dadf82..5445bf74092 100644 --- a/Build/source/texk/ps2pk/pk2bm.c +++ b/Build/source/texk/ps2pk/pk2bm.c @@ -64,18 +64,21 @@ int main(int argc, char *argv[]) if (*++argv[0] == '\0') { argc--; argv++; } + if (argv[0] == '\0') goto invalid; C = *argv[0]; done = 1; break; case 'o': if (*++argv[0] == '\0') { argc--; ++argv; } + if (argv[0] == '\0') goto invalid; C = atoo(argv[0]); done = 1; break; case 'H': if (*++argv[0] == '\0') { argc--; argv++; } + if (argv[0] == '\0') goto invalid; h = atoi(argv[0]); done=1; break; @@ -83,6 +86,7 @@ int main(int argc, char *argv[]) if (*++argv[0] == '\0') { argc--; argv++; } + if (argv[0] == '\0') goto invalid; w = atoi(argv[0]); done=1; break; @@ -92,6 +96,7 @@ int main(int argc, char *argv[]) case 'h': hexmap = 1; break; +invalid: default: printf("%s: %c invalid option\n", myname, c); exit(1); |