Silence a CI warning regarding the use of strcpy().
While this is a false positive (a sufficiently large buffer has been allocated in the line above), the use of strdup() simplifies and clarifies the code. MFC after: 2 weeks
This commit is contained in:
parent
a8ef188288
commit
5f81babdee
@ -241,8 +241,7 @@ get_font(void)
|
|||||||
if (strcmp(buf, "NO")) {
|
if (strcmp(buf, "NO")) {
|
||||||
if (fnt)
|
if (fnt)
|
||||||
free(fnt);
|
free(fnt);
|
||||||
fnt = (char *) malloc(strlen(buf) + 1);
|
fnt = strdup(buf);
|
||||||
strcpy(fnt, buf);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user