From: RĂ©mi Duraffort Date: Mon, 19 Jan 2009 20:27:31 +0000 (+0100) Subject: taglib: change just a bit the code. X-Git-Tag: 1.0.0-pre1~1186 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=a02b83a7477ed76d26451b14bc4ecc50ea9e21b0;p=vlc taglib: change just a bit the code. --- diff --git a/modules/meta_engine/taglib.cpp b/modules/meta_engine/taglib.cpp index b2fd8064ef..bab3414d51 100644 --- a/modules/meta_engine/taglib.cpp +++ b/modules/meta_engine/taglib.cpp @@ -131,15 +131,9 @@ static void ReadMetaFromId3v2( ID3v2::Tag* tag, demux_t* p_demux, demux_meta_t* * but in our case it will be a '\0' * terminated string */ char psz_ufid[64]; - int j = 0; - int max_size = p_ufid->identifier().size() < 63 ? - p_ufid->identifier().size() : 63; - while( j < max_size ) - { - psz_ufid[j] = p_ufid->identifier()[j]; - j++; - } - psz_ufid[j] = '\0'; + int max_size = __MIN( p_ufid->identifier().size(), 63); + strncmp( psz_ufid, p_ufid->identifier().data(), max_size ); + psz_ufid[max_size] = '\0'; vlc_meta_SetTrackID( p_meta, psz_ufid ); } }