Rewrite strcpy usage

This commit is contained in:
twinaphex 2016-06-27 08:09:34 +02:00
parent 946de514dc
commit f5bfbdeebe
2 changed files with 3 additions and 3 deletions

View File

@ -1077,7 +1077,7 @@ static bool cg_d3d9_renderchain_add_lut(void *data,
info.tex = lut;
info.smooth = smooth;
strcpy(info.id, id);
strlcpy(info.id, id, sizeof(info.id));
if (!lut)
return false;

View File

@ -287,7 +287,7 @@ bool content_save_state(const char *path, bool save_to_disk)
memcpy(undo_load_buf.data, data, info.size);
undo_load_buf.size = info.size;
strcpy(undo_load_buf.path, path);
strlcpy(undo_load_buf.path, path, sizeof(undo_load_buf.path));
}
}
else
@ -352,7 +352,7 @@ bool content_load_state(const char *path, bool load_to_backup_buffer)
memcpy(undo_save_buf.data, buf, size);
undo_save_buf.size = size;
strcpy(undo_save_buf.path, path);
strlcpy(undo_save_buf.path, path, sizeof(undo_save_buf.path));
free(buf);
return true;