summaryrefslogtreecommitdiff
path: root/Build/source/texk/ps2pk
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-12-01 23:02:12 +0000
committerKarl Berry <karl@freefriends.org>2018-12-01 23:02:12 +0000
commit4484aeff0a1b8b75c1033650ef7bcb372058624f (patch)
tree494eb00b8659287add981ccb5c8a8e203b07784d /Build/source/texk/ps2pk
parent27246c049dae50cb3d8ab9fa00897ed1f1a6adf3 (diff)
check for missing args; Hironobu mail to tex-k, 1 Dec 2018 08:04:39
git-svn-id: svn://tug.org/texlive/trunk@49302 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/ps2pk')
-rw-r--r--Build/source/texk/ps2pk/ChangeLog5
-rw-r--r--Build/source/texk/ps2pk/ps2pk.c15
2 files changed, 17 insertions, 3 deletions
diff --git a/Build/source/texk/ps2pk/ChangeLog b/Build/source/texk/ps2pk/ChangeLog
index 6657c92b11b..c01adf53cd3 100644
--- a/Build/source/texk/ps2pk/ChangeLog
+++ b/Build/source/texk/ps2pk/ChangeLog
@@ -1,3 +1,8 @@
+2018-12-01 Hironobu Yamashita <h.y.acetaminophen@gmail.com>
+
+ * ps2pk.c: check for missing arguments.
+ tex-k mail 1 Dec 2018 08:04:39.
+
2018-09-09 Karl Berry <karl@tug.org>
* tests/ps2pk.test: LC_ALL=LANGUAGE=C.
diff --git a/Build/source/texk/ps2pk/ps2pk.c b/Build/source/texk/ps2pk/ps2pk.c
index 40d99c578db..c59d9a7f82b 100644
--- a/Build/source/texk/ps2pk/ps2pk.c
+++ b/Build/source/texk/ps2pk/ps2pk.c
@@ -2,20 +2,20 @@
* NAME
* ps2pk - creates a PK font from a type1 PostScript font
* SYNOPSIS:
- * pk2pk [options] type1 [pkname]
+ * ps2pk [options] type1 [pkname]
* DESCRIPTION
* This program renders a given type1 PostScript font at a given
* pointsize (default 10.0 points) and resolution (default 300dpi)
* into a TeX PK font.
*
- * To generate the PK font pk2ps needs a valid type1 fontname (for
+ * To generate the PK font ps2pk needs a valid type1 fontname (for
* example Utopia-Regular.pfa) and its corresponding AFMfile
* (Utopia-Regular.afm). The program accepts both the MSDOS binary
* type1 format (Utopia-Regula.pfb) and its UNIX ASCII equivalent
* (Utopia-Regula.pfa). The resulting PK font does contain all
* characters for which the C-code is non negative. This can be
* overruled by specifying an explicit <encoding> via the -e<encoding>
- * option. Character codes in AMF files are specified as integer values
+ * option. Character codes in AFM files are specified as integer values
* after the C, for example Utopia-Regular.afm provides:
* C 251 ; WX 601 ; N germandbls ; B 22 -12 573 742 ;
* C -1 ; WX 380 ; N onesuperior ; B 81 272 307 680 ;
@@ -269,6 +269,7 @@ int main(int argc, char *argv[])
if (*++argv[0] == '\0') {
argc--; argv++;
}
+ if (argv[0] == '\0') goto invalid;
afmname = argv[0];
done = 1;
break;
@@ -279,6 +280,7 @@ int main(int argc, char *argv[])
if (*++argv[0] == '\0') {
argc--; argv++;
}
+ if (argv[0] == '\0') goto invalid;
encname = argv[0];
add_option("-e", encname);
done = 1;
@@ -287,6 +289,7 @@ int main(int argc, char *argv[])
if (*++argv[0] == '\0') {
argc--; argv++;
}
+ if (argv[0] == '\0') goto invalid;
efactor = atof(argv[0]);
add_option("-E", argv[0]);
done = 1;
@@ -299,6 +302,7 @@ int main(int argc, char *argv[])
if (*++argv[0] == '\0') {
argc--; argv++;
}
+ if (argv[0] == '\0') goto invalid;
pointsize = atof(argv[0]);
add_option("-P", argv[0]);
done = 1;
@@ -307,6 +311,7 @@ int main(int argc, char *argv[])
if (*++argv[0] == '\0') {
argc--; argv++;
}
+ if (argv[0] == '\0') goto invalid;
base_resolution = atoi(argv[0]);
add_option("-R", argv[0]);
done = 1;
@@ -315,6 +320,7 @@ int main(int argc, char *argv[])
if (*++argv[0] == '\0') {
argc--; argv++;
}
+ if (argv[0] == '\0') goto invalid;
slant = atof(argv[0]);
add_option("-S", argv[0]);
done = 1;
@@ -323,6 +329,7 @@ int main(int argc, char *argv[])
if (*++argv[0] == '\0') {
argc--; argv++;
}
+ if (argv[0] == '\0') goto invalid;
x_resolution = atoi(argv[0]); done = 1;
if (y_resolution == 0) y_resolution = x_resolution;
add_option("-X", argv[0]);
@@ -331,6 +338,7 @@ int main(int argc, char *argv[])
if (*++argv[0] == '\0') {
argc--; argv++;
}
+ if (argv[0] == '\0') goto invalid;
y_resolution = atoi(argv[0]); done = 1;
if (x_resolution == 0) x_resolution = y_resolution;
add_option("-Y", argv[0]);
@@ -338,6 +346,7 @@ int main(int argc, char *argv[])
case 'v':
verbose = 1;
break;
+invalid:
default:
fatal("%s: %c invalid option\n", myname, c);
}