[vlc-commits] subsusf: simplification

Rémi Denis-Courmont git at videolan.org
Thu Apr 24 21:45:24 CEST 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Apr 24 22:44:55 2014 +0300| [c4aad5aaaacba1ffb5050dd808ee0c142fbc3348] | committer: Rémi Denis-Courmont

subsusf: simplification

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c4aad5aaaacba1ffb5050dd808ee0c142fbc3348
---

 modules/codec/subsusf.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/modules/codec/subsusf.c b/modules/codec/subsusf.c
index 74a9cf7..0952e30 100644
--- a/modules/codec/subsusf.c
+++ b/modules/codec/subsusf.c
@@ -1065,12 +1065,10 @@ static char *StripTags( char *psz_subtitle )
 
         psz_subtitle++;
     }
-    *psz_text = '\0';
+    *psz_text++ = '\0';
 
-    char *psz = realloc( psz_text_start, strlen( psz_text_start ) + 1 );
-    if( psz ) psz_text_start = psz;
-
-    return psz_text_start;
+    char *psz = realloc( psz_text_start, psz_text - psz_text_start );
+    return likely(psz != NULL) ? psz : psz_text_start;
 }
 
 /* Turn a HTML subtitle, turn into a plain-text version,



More information about the vlc-commits mailing list