[vlc-devel] [PATCH] Taglib: undefined operation de to duplicate usage of var with post-increment

Dominique Leuenberger dominique at leuenberger.net
Sat Jan 17 16:32:45 CET 2009


I: Program causes undefined operation
(likely same variable used twiceand post/pre incremented in the same expression).
e.g. x = x++; Split it in two operations.
E: vlc-beta sequence-point taglib.cpp:138
---
 modules/meta_engine/taglib.cpp |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/modules/meta_engine/taglib.cpp b/modules/meta_engine/taglib.cpp
index 2aa740b..ad0261f 100644
--- a/modules/meta_engine/taglib.cpp
+++ b/modules/meta_engine/taglib.cpp
@@ -135,7 +135,8 @@ static void ReadMetaFromId3v2( ID3v2::Tag* tag, demux_t* p_demux, demux_meta_t*
             int max_size = p_ufid->identifier().size() < 63 ?
                            p_ufid->identifier().size() : 63;
             while( j < max_size )
-                psz_ufid[j] = p_ufid->identifier()[j++];
+                psz_ufid[j] = p_ufid->identifier()[j];
+                j++;
             psz_ufid[j] = '\0';
             vlc_meta_SetTrackID( p_meta, psz_ufid );
         }
-- 
1.5.4.5




More information about the vlc-devel mailing list