summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvipsk/color.c
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-02-21 00:19:50 +0000
committerKarl Berry <karl@freefriends.org>2018-02-21 00:19:50 +0000
commitad360fe7b6421e7f688c1fc7f1ec7db6da66c59d (patch)
tree2c6f901d07a46b60cae47c49e19d174e84b8fd96 /Build/source/texk/dvipsk/color.c
parent5c8d267d751a63bdaf761c0e039205cf714b2946 (diff)
avoid ersatz array as last struct member
git-svn-id: svn://tug.org/texlive/trunk@46693 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvipsk/color.c')
-rw-r--r--Build/source/texk/dvipsk/color.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Build/source/texk/dvipsk/color.c b/Build/source/texk/dvipsk/color.c
index d4b0867320c..f78d52630b3 100644
--- a/Build/source/texk/dvipsk/color.c
+++ b/Build/source/texk/dvipsk/color.c
@@ -37,7 +37,7 @@ static struct colorpage {
struct colorpage *next;
integer boploc; /* we use the bop loc as a page indicator */
char *bg;
- char colordat[2];
+ char *colordat;
} *colorhash[COLORHASH];
static char *cstack, *csp, *cend, *bg;
/*
@@ -84,6 +84,7 @@ void initcolor(void) {
for (i=0; i<COLORHASH; i++) {
for (p=colorhash[i]; p; p = q) {
q = p->next;
+ free(p->colordat);
free(p);
}
colorhash[i] = 0;
@@ -216,7 +217,8 @@ bopcolor(int outtops)
}
} else {
p = (struct colorpage *)mymalloc((integer)
- (strlen(cstack) + sizeof(struct colorpage) + MAXCOLORLEN));
+ (sizeof(struct colorpage)));
+ p->colordat = mymalloc(strlen(cstack) + MAXCOLORLEN + 2);
p->next = colorhash[h];
p->boploc = pageloc;
strcpy(p->colordat, cstack);