[vlc-devel] commit: Taglib: undefined operation due to duplicate usage of var with post-increment ( Dominique Leuenberger )
Laurent Aimar
fenrir at via.ecp.fr
Sun Jan 18 13:00:29 CET 2009
Hi,
On Sun, Jan 18, 2009, git version control wrote:
> vlc | branch: master | Dominique Leuenberger <dominique at leuenberger.net> | Sat Jan 17 16:31:03 2009 +0100| [0efd13d685978ce368cfe546859d33945321272c] | committer: Rémi Duraffort
>
> Taglib: undefined operation due to duplicate usage of var with post-increment
>
> Signed-off-by: Rémi Duraffort <ivoire at videolan.org>
>
> > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0efd13d685978ce368cfe546859d33945321272c
> ---
>
> modules/meta_engine/taglib.cpp | 5 ++++-
> 1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/modules/meta_engine/taglib.cpp b/modules/meta_engine/taglib.cpp
> index 2aa740b..b2fd806 100644
> --- a/modules/meta_engine/taglib.cpp
> +++ b/modules/meta_engine/taglib.cpp
> @@ -135,7 +135,10 @@ 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++;
> + }
Rooo, please:
for( j = 0; j < max_size; j++ )
psz_ufid[j] = p_ufid->identifier()[j];
or even
for( j = 0; j < _MIN( p_ufid->identifier().size(), 63) ) j++ )
psz_ufid[j] = p_ufid->identifier()[j];
and why not a simple memcpy or strncpy ?
--
fenrir
More information about the vlc-devel
mailing list