texlive[49302] Build/source/texk/ps2pk: check for missing args;

commits+karl at tug.org commits+karl at tug.org
Sun Dec 2 00:02:12 CET 2018


Revision: 49302
          http://tug.org/svn/texlive?view=revision&revision=49302
Author:   karl
Date:     2018-12-02 00:02:12 +0100 (Sun, 02 Dec 2018)
Log Message:
-----------
check for missing args; Hironobu mail to tex-k, 1 Dec 2018 08:04:39

Modified Paths:
--------------
    trunk/Build/source/texk/ps2pk/ChangeLog
    trunk/Build/source/texk/ps2pk/ps2pk.c

Modified: trunk/Build/source/texk/ps2pk/ChangeLog
===================================================================
--- trunk/Build/source/texk/ps2pk/ChangeLog	2018-12-01 22:51:36 UTC (rev 49301)
+++ trunk/Build/source/texk/ps2pk/ChangeLog	2018-12-01 23:02:12 UTC (rev 49302)
@@ -1,3 +1,8 @@
+2018-12-01  Hironobu Yamashita  <h.y.acetaminophen at gmail.com>
+
+	* ps2pk.c: check for missing arguments.
+	tex-k mail 1 Dec 2018 08:04:39.
+
 2018-09-09  Karl Berry  <karl at tug.org>
 
 	* tests/ps2pk.test: LC_ALL=LANGUAGE=C.

Modified: trunk/Build/source/texk/ps2pk/ps2pk.c
===================================================================
--- trunk/Build/source/texk/ps2pk/ps2pk.c	2018-12-01 22:51:36 UTC (rev 49301)
+++ trunk/Build/source/texk/ps2pk/ps2pk.c	2018-12-01 23:02:12 UTC (rev 49302)
@@ -2,13 +2,13 @@
  * 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
@@ -15,7 +15,7 @@
  *	(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 @@
       	    if (*++argv[0] == '\0') {
       	       argc--; argv++;
       	    }
+      	    if (argv[0] == '\0') goto invalid;
 	    afmname = argv[0]; 
 	    done = 1;
       	    break;
@@ -279,6 +280,7 @@
       	    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 @@
       	    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 @@
       	    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 @@
       	    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 @@
       	    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 @@
       	    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 @@
       	    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 @@
       	 case 'v':
       	    verbose = 1;
 	    break;
+invalid:
       	 default:
       	    fatal("%s: %c invalid option\n", myname, c);
       	 }



More information about the tex-live-commits mailing list