[vlc-commits] Avoid char conversion in strchr() - fixes #6266

Rémi Denis-Courmont git at videolan.org
Sun Mar 4 10:17:14 CET 2012


vlc/vlc-2.0 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Mar  2 18:44:35 2012 +0200| [8a99cd630145699e933aaa49ef40ec0bf415aef6] | committer: Rémi Denis-Courmont

Avoid char conversion in strchr() - fixes #6266

(cherry picked from commit d843a2fc47bf6b9f4277310736b25caee8309ee7)

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

 src/text/strings.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/text/strings.c b/src/text/strings.c
index 4b51a6b..c1a7493 100644
--- a/src/text/strings.c
+++ b/src/text/strings.c
@@ -422,7 +422,7 @@ char *convert_xml_special_chars (const char *str)
         }
 
         if ((cp & ~0x0080) < 32 /* C0/C1 control codes */
-         && strchr ("\x09\x0A\x0D\x85", cp) == NULL)
+         && memchr ("\x09\x0A\x0D\x85", cp, 4) == NULL)
             ptr += sprintf (ptr, "&#%"PRIu32";", cp);
         else
         switch (cp)



More information about the vlc-commits mailing list