From a02b83a7477ed76d26451b14bc4ecc50ea9e21b0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Duraffort?= Date: Mon, 19 Jan 2009 21:27:31 +0100 Subject: [PATCH] taglib: change just a bit the code. --- modules/meta_engine/taglib.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) 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 ); } } -- 2.39.2