arraylist_add: don't overflow when strcpy to the icon
This commit is contained in:
parent
c68c0169d4
commit
098403eba6
1 changed files with 1 additions and 1 deletions
2
file.c
2
file.c
|
@ -69,7 +69,7 @@ void arraylist_remove(ArrayList *list, long index)
|
|||
void arraylist_add(ArrayList *list, char *name, char *path, char *stats, int type, char *icon, int color, int marked, int force)
|
||||
{
|
||||
file new_file = { name, path, type, stats, color };
|
||||
strcpy(new_file.icon, icon);
|
||||
strncpy(new_file.icon, icon, sizeof(new_file.icon) / sizeof(new_file.icon[0]));
|
||||
|
||||
if (list->capacity != list->length) {
|
||||
if (marked) {
|
||||
|
|
Loading…
Reference in a new issue