summaryrefslogtreecommitdiffstats
path: root/print/dvi2tty/files/patch-ad
blob: eadeb64707acfc8fabb0e2769895cb451d49f016 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
--- dvistuff.c.orig	Fri Mar 12 01:05:35 1993
+++ dvistuff.c	Mon May  6 04:48:49 1996
@@ -996,13 +996,14 @@
     }
     else
         free(fnt->name);    /* free old name */
-    if ((name = (char *) malloc(namelen * sizeof(char))) == NULL) {
+    if ((name = (char *) malloc((namelen + 1) * sizeof(char))) == NULL) {
         perror("fontdef");
         exit(1);
     }
     
     for (i = 0; i < namelen; i++)
         name[i] = get1();
+    name[namelen] = '\0';
     fnt->name = name;
     if (new) {
         fnt->next = fonts;
OpenPOWER on IntegriCloud