]> git.sesse.net Git - vlc/commitdiff
taglib: change just a bit the code.
authorRémi Duraffort <ivoire@videolan.org>
Mon, 19 Jan 2009 20:27:31 +0000 (21:27 +0100)
committerRémi Duraffort <ivoire@videolan.org>
Mon, 19 Jan 2009 20:27:31 +0000 (21:27 +0100)
modules/meta_engine/taglib.cpp

index b2fd8064eff0adc905b519a52ab7c4f607f0645e..bab3414d5130db9c703b53d6cc3d0ec3b1bc52c3 100644 (file)
@@ -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 );
         }
     }