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.
This commit is contained in:
pstef 2025-03-20 16:51:58 +00:00
parent b85bcb8e48
commit 3fb7d190bf

View file

@ -722,8 +722,7 @@ int detect_sat_game(intfstream_t *fd, char *s, size_t len, const char *filename)
&& raw_game_id[1] == 'K'
&& raw_game_id[2] == '-')
{
strncpy(s, &raw_game_id[3], __len - 3);
s[__len - 3] = '\0';
strlcpy(s, &raw_game_id[3], len);
}
else
strlcpy(s, raw_game_id, len);