Skip to content

Commit 3fb7d19

Browse files
committed
Silence warning about possible truncation
Also simplify this part; the point here is to start the copy later, but otherwise the buffer size is the same, and it's still a string, so needs no special handling.
1 parent b85bcb8 commit 3fb7d19

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

tasks/task_database_cue.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -722,8 +722,7 @@ int detect_sat_game(intfstream_t *fd, char *s, size_t len, const char *filename)
722722
&& raw_game_id[1] == 'K'
723723
&& raw_game_id[2] == '-')
724724
{
725-
strncpy(s, &raw_game_id[3], __len - 3);
726-
s[__len - 3] = '\0';
725+
strlcpy(s, &raw_game_id[3], len);
727726
}
728727
else
729728
strlcpy(s, raw_game_id, len);

0 commit comments

Comments
 (0)