use strlcpy instead of strcpy

This commit is contained in:
2025-07-03 19:15:47 -04:00
parent 101ebe171f
commit 4d14542abd

View File

@@ -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) {