w_merge.c: replace strncpy() with memcpy() in FindSpriteFrame()

The sprname field of struct sprite_frame_t is supposed to contain the
four byte prefix for the sprite names, not an actual string with a
NULL byte delimiter.

This fixes a new compiler warning detected by @turol, fixes #1031.

Thanks @turol and @AXDOOMER for the discussion!
This commit is contained in:
Fabian Greffrath 2018-05-06 13:23:02 +02:00
parent 00311e89f5
commit 9a8f5dc9d9

View file

@ -216,7 +216,7 @@ static sprite_frame_t *FindSpriteFrame(char *name, int frame)
// Add to end of list // Add to end of list
result = &sprite_frames[num_sprite_frames]; result = &sprite_frames[num_sprite_frames];
strncpy(result->sprname, name, 4); memcpy(result->sprname, name, 4);
result->frame = frame; result->frame = frame;
for (i=0; i<8; ++i) for (i=0; i<8; ++i)