[vlc-commits] compat: Fix strnstr implementation

Hugo Beauzée-Luyssen git at videolan.org
Wed Dec 9 18:05:35 CET 2015


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Wed Dec  9 18:04:38 2015 +0100| [56fd4ad559169c2a44ce9d5cbd7961b62e24762e] | committer: Hugo Beauzée-Luyssen

compat: Fix strnstr implementation

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

 compat/strnstr.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compat/strnstr.c b/compat/strnstr.c
index abdc3ea..b2d47d1 100644
--- a/compat/strnstr.c
+++ b/compat/strnstr.c
@@ -40,7 +40,7 @@ char * strnstr (const char *haystack, const char *needle, size_t len)
 
     do
     {
-      if( memcmp(haystack, needle, i) )
+      if( memcmp(haystack, needle, i) == 0 )
         return (char*) haystack;
       haystack++;
     }



More information about the vlc-commits mailing list