From 39abb5f89c9322db41853ccc66e0c2d45037ffa4 Mon Sep 17 00:00:00 2001 From: pancake Date: Wed, 23 Sep 2015 02:01:08 +0200 Subject: [PATCH] Update capstone from git --- shlr/Makefile | 4 ++-- shlr/capstone-patches/fix-cygwin.patch | 13 ------------- shlr/sdb/src/util.c | 17 ++++++++++++----- 3 files changed, 14 insertions(+), 20 deletions(-) delete mode 100644 shlr/capstone-patches/fix-cygwin.patch diff --git a/shlr/Makefile b/shlr/Makefile index 7f497dc075..8774558585 100644 --- a/shlr/Makefile +++ b/shlr/Makefile @@ -10,9 +10,9 @@ CS_VER=3.0 CS_TAR=http://capstone-engine.org/download/$(CS_VER)/capstone-$(CS_VER).tgz CS_TAR= CS_URL=$(GIT_PREFIX)github.com/aquynh/capstone.git -CS_UPD=20150911 +CS_UPD=20150923 CS_BRA=next -CS_TIP=7b714c64dc35cf5fa2f04de49d1858b6ae69f169 +CS_TIP=839f06e855a38499de82b3014101fa1706fba994 # REVERT THIS COMMIT BECAUSE ITS WRONG CS_REV= #21b9b25e9dae4af0ef309d4089a54e53b8f5b479 diff --git a/shlr/capstone-patches/fix-cygwin.patch b/shlr/capstone-patches/fix-cygwin.patch deleted file mode 100644 index ba15af61d3..0000000000 --- a/shlr/capstone-patches/fix-cygwin.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/include/capstone/platform.h b/include/capstone/platform.h -index 1a0f07a..12132f5 100644 ---- a/include/capstone/platform.h -+++ b/include/capstone/platform.h -@@ -5,7 +5,7 @@ - #ifndef CAPSTONE_PLATFORM_H - #define CAPSTONE_PLATFORM_H - --#if !defined(__MINGW32__) && !defined(__MINGW64__) && (defined (WIN32) || defined (WIN64) || defined (_WIN32) || defined (_WIN64)) -+#if !defined(__CYGWIN__) && !defined(__MINGW32__) && !defined(__MINGW64__) && (defined (WIN32) || defined (WIN64) || defined (_WIN32) || defined (_WIN64)) - // MSVC - - // stdbool.h diff --git a/shlr/sdb/src/util.c b/shlr/sdb/src/util.c index 31ffb32b8b..3107571a2c 100644 --- a/shlr/sdb/src/util.c +++ b/shlr/sdb/src/util.c @@ -50,12 +50,16 @@ SDB_API char *sdb_itoa(ut64 n, char *s, int base) { static const char* lookup = "0123456789abcdef"; char tmpbuf[64], *os = NULL; const int imax = 62; - int i = imax; + int i = imax, copy_string = 1; if (s) { *s = 0; } else { os = s = tmpbuf; } + if (base < 0) { + copy_string = 0; + base = -base; + } if ((base > 16) || (base < 1)) return NULL; if (!n) { @@ -77,10 +81,13 @@ SDB_API char *sdb_itoa(ut64 n, char *s, int base) { if (os) { return strdup (s+i+1); } - // unnecessary memmove in case we use the return value - // return s + i + 1; - memmove (s, s+i+1, strlen (s+i+1)+1); - return s; + if (copy_string) { + // unnecessary memmove in case we use the return value + // return s + i + 1; + memmove (s, s+i+1, strlen (s+i+1)+1); + return s; + } + return s + i + 1; } SDB_API ut64 sdb_atoi(const char *s) {