Alexandre Julliard : libwine: Avoid memrchr.

Alexandre Julliard julliard at winehq.org
Wed Jun 6 15:35:19 CDT 2012


Module: wine
Branch: master
Commit: cbdc795515a040e2927d35c973561083752d42bb
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=cbdc795515a040e2927d35c973561083752d42bb

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Jun  6 12:39:33 2012 +0200

libwine: Avoid memrchr.

---

 libs/wine/config.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/libs/wine/config.c b/libs/wine/config.c
index 349fb7d..df5c33b 100644
--- a/libs/wine/config.c
+++ b/libs/wine/config.c
@@ -165,7 +165,8 @@ static char *get_runtime_bindir( const char *argv0 )
         if ((ret = readlink( EXE_LINK, bindir, size )) == -1) break;
         if (ret != size)
         {
-            if (!(p = memrchr( bindir, '/', ret ))) break;
+            bindir[ret] = 0;
+            if (!(p = strrchr( bindir, '/' ))) break;
             if (p == bindir) p++;
             *p = 0;
             return bindir;




More information about the wine-cvs mailing list