Skip to content

Commit

Permalink
[name.c] Fix char init
Browse files Browse the repository at this point in the history
  • Loading branch information
kaydeearts committed May 6, 2021
1 parent 3d901ad commit 33acc7d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion c/makeotf/makeotf_lib/source/hotconv/name.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ static void addName(nameCtx h,
unsigned short nameId,
size_t length, char *str) {
char *dst;
char newStr[length];
char *newStr;
newStr = MEM_NEW(h->g, length * sizeof(char));
NameRecord *rec;
int index;
int omitMacNames = (h->g->convertFlags & HOT_OMIT_MAC_NAMES); /* omit all Mac platform names. */
Expand Down Expand Up @@ -201,6 +202,7 @@ static void addName(nameCtx h,
strncpy(newStr, str, length);
dst = dnaEXTEND(h->addstrs, (long)length + 1);
strncpy(dst, newStr, length);
MEM_FREE(h->g, newStr);
dst[length] = '\0';
}

Expand Down

0 comments on commit 33acc7d

Please sign in to comment.