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
bb4c46d45b
commit
e1fb642c4c
@ -241,8 +241,7 @@ get_font(void)
|
||||
if (strcmp(buf, "NO")) {
|
||||
if (fnt)
|
||||
free(fnt);
|
||||
fnt = (char *) malloc(strlen(buf) + 1);
|
||||
strcpy(fnt, buf);
|
||||
fnt = strdup(buf);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user