From d8f96a765d352b7a235bdb2d2d17ebaec6bfa896 Mon Sep 17 00:00:00 2001 From: pancake Date: Mon, 23 Feb 2015 01:55:35 +0100 Subject: [PATCH] Fix android build and bin/d installation issue --- binr/blob/Makefile | 2 ++ libr/bin/d/Makefile | 3 ++- libr/util/p_format.c | 2 ++ libr/util/print.c | 2 +- shlr/zip/deps.mk | 6 +++++- 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/binr/blob/Makefile b/binr/blob/Makefile index 03c151066c..5e2dd15fbf 100644 --- a/binr/blob/Makefile +++ b/binr/blob/Makefile @@ -4,6 +4,7 @@ DESTDIR?=/ BINS=rabin2 rarun2 rasm2 ragg2 rahash2 rax2 rafind2 radiff2 BINS2=radare2 ${BINS} +SHLR=../../shlr include ../../config-user.mk include ../../shlr/zip/deps.mk @@ -79,6 +80,7 @@ LDFLAGS+=-L../../libr/debug -lr_debug LDFLAGS+=-L../../libr/search -lr_search LDFLAGS+=-L../../libr/config -lr_config endif +LDFLAGS+=${LINK} all: symlinks diff --git a/libr/bin/d/Makefile b/libr/bin/d/Makefile index a4333ff185..984a1fcdfc 100644 --- a/libr/bin/d/Makefile +++ b/libr/bin/d/Makefile @@ -18,9 +18,10 @@ clean: .PHONY: all clean install install-symlink symstall install: ${F_SDB} + @echo "[i] Installing bin format files" rm -rf "$P" mkdir -p "$P" - cp -f * "$P" + -cp -f * "$P" mkdir -p "$P/dll" cp -f dll/*.sdb "$P" diff --git a/libr/util/p_format.c b/libr/util/p_format.c index 0e51a475f4..990eca9f88 100644 --- a/libr/util/p_format.c +++ b/libr/util/p_format.c @@ -1249,6 +1249,8 @@ R_API int r_print_format(RPrint *p, ut64 seek, const ut8* b, const int len, if (size >= ARRAYINDEX_COEF) { elem = size/ARRAYINDEX_COEF-1; size %= ARRAYINDEX_COEF; + } else { + elem = 0; } if (!(mode & R_PRINT_ISFIELD)) nxtfield = MINUSONE; else if (field) nxtfield = strchr (ofield, '.'); diff --git a/libr/util/print.c b/libr/util/print.c index 1bdde8bc05..476dc1a450 100644 --- a/libr/util/print.c +++ b/libr/util/print.c @@ -245,7 +245,7 @@ R_API char *r_print_hexpair(RPrint *p, const char *str, int n) { const char *s, *lastcol = Color_WHITE; char *d, *dst = (char *)malloc ((strlen (str)+2)*32); int colors = p->flags & R_PRINT_FLAGS_COLOR; - const char *color_0x00, *color_0x7f, *color_0xff, *color_text, *color_other; + const char *color_0x00 = "", *color_0x7f = "", *color_0xff = "", *color_text = "", *color_other = ""; int bs = p->bytespace; /* XXX That's hacky as shit.. but partially works O:) */ /* TODO: Use r_print_set_cursor for win support */ diff --git a/shlr/zip/deps.mk b/shlr/zip/deps.mk index 6542692cf1..e0e513e625 100644 --- a/shlr/zip/deps.mk +++ b/shlr/zip/deps.mk @@ -1,6 +1,10 @@ +#ifeq ($(SHLR),) +#SHLR=../../shlr +#endif + ifeq ($(USE_LIB_ZIP),1) LINK+=$(LIBZIP) else -LINK+=$(STOP)/zip/librz.a +LINK+=$(SHLR)/zip/librz.a CFLAGS+=-I$(SHLR)/zip/include endif