Commit 242d1c2e authored by Francois Cartegnie's avatar Francois Cartegnie

acoustid: use memcpy (cid #1062538)

strncpy triggers warning because the
struct is nonzero terminated.
parent 243e0951
......@@ -328,7 +328,7 @@ static void fill_metas_with_results( fingerprint_request_t *p_r, acoustid_finger
{
vlc_meta_Set( p_meta, vlc_meta_Title, p_record->psz_title );
vlc_meta_Set( p_meta, vlc_meta_Artist, p_record->psz_artist );
vlc_meta_AddExtra( p_meta, "musicbrainz-id", p_record->sz_musicbrainz_id );
vlc_meta_AddExtra( p_meta, "musicbrainz-id", p_record->s_musicbrainz_id );
vlc_array_append( & p_r->results.metas_array, p_meta );
}
}
......
......@@ -81,9 +81,9 @@ static void parse_recordings( vlc_object_t *p_obj, json_value *node, acoustid_re
record->psz_title = strdup( value->u.string.ptr );
value = jsongetbyname( recordnode, "id" );
if ( value && value->type == json_string )
strncpy( record->sz_musicbrainz_id, value->u.string.ptr, MB_ID_SIZE );
memcpy( record->s_musicbrainz_id, value->u.string.ptr, MB_ID_SIZE );
parse_artists( jsongetbyname( recordnode, "artists" ), record );
msg_Dbg( p_obj, "recording %d title %s %36s %s", i, record->psz_title, record->sz_musicbrainz_id, record->psz_artist );
msg_Dbg( p_obj, "recording %d title %s %36s %s", i, record->psz_title, record->s_musicbrainz_id, record->psz_artist );
}
}
......
......@@ -24,7 +24,7 @@ struct musicbrainz_recording_t
{
char *psz_artist;
char *psz_title;
char sz_musicbrainz_id[MB_ID_SIZE];
char s_musicbrainz_id[MB_ID_SIZE];
};
typedef struct musicbrainz_recording_t musicbrainz_recording_t;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment