Fix build

This commit is contained in:
pancake 2017-01-24 00:50:22 +01:00
parent 446d4b27db
commit dc203aeb27
3 changed files with 4 additions and 4 deletions

View File

@ -2944,7 +2944,7 @@ static void delete_last_comment(RDisasmState *ds) {
int len = 0;
char *ll = r_cons_lastline (&len);
if (ll) {
char *begin = strnstr (ll, "; ", len);
const char *begin = r_str_nstr (ll, "; ", len);
if (begin) {
const int cstrlen = strlen (ll);
r_cons_drop (cstrlen - (int)(begin - ll));

View File

@ -75,7 +75,7 @@ R_API char *r_str_trim_head_tail(char *str);
R_API ut32 r_str_hash(const char *str);
R_API ut64 r_str_hash64(const char *str);
R_API char *r_str_clean(char *str);
R_API int r_str_nstr(char *from, char *to, int size);
R_API const char *r_str_nstr(const char *from, const char *to, int size);
R_API const char *r_str_lchr(const char *str, char chr);
R_API const char *r_sub_str_lchr(const char *str, int start, int end, char chr);
R_API const char *r_sub_str_rchr(const char *str, int start, int end, char chr);

View File

@ -622,14 +622,14 @@ R_API const char *r_str_rchr(const char *base, const char *p, int ch) {
return (p < base) ? NULL : p;
}
R_API int r_str_nstr(char *from, char *to, int size) {
R_API const char *r_str_nstr(const char *from, const char *to, int size) {
int i;
for (i = 0; i < size; i++) {
if (!from || !to || from[i] != to[i]) {
break;
}
}
return (size!=i);
return from + i;
}
// TODO: rewrite in macro?