use strlcpy instead of strcpy
This commit is contained in:
3
mpd_ws.c
3
mpd_ws.c
@@ -254,7 +254,8 @@ void mpd_ws_update_song(struct mpd_ws_server *server) {
|
||||
/* Only broadcast if song actually changed */
|
||||
if (strcmp(server->current_song, server->previous_song) != 0) {
|
||||
client_broadcast(server, server->current_song);
|
||||
strcpy(server->previous_song, server->current_song);
|
||||
strlcpy(server->previous_song, server->current_song,
|
||||
sizeof(server->previous_song));
|
||||
}
|
||||
|
||||
if (song) {
|
||||
|
||||
Reference in New Issue
Block a user