diff --git a/libr/include/r_util/r_str.h b/libr/include/r_util/r_str.h index 03aa1c65101e93..ae02101ab245e6 100644 --- a/libr/include/r_util/r_str.h +++ b/libr/include/r_util/r_str.h @@ -66,7 +66,7 @@ typedef struct r_charset_t { #define R_STR_ISEMPTY(x) (!(x) || !*(x)) #define R_STR_ISNOTEMPTY(x) ((x) && *(x)) #define R_STR_DUP(x) (((x) != NULL) ? strdup ((x)) : NULL) -#define R_STR_NDUP(ptr, len) ((!ptr || len < 0) ? NULL : strndup (ptr, len)) +#define R_STR_NDUP(ptr, len) ((((ptr) == NULL) || len < 0) ? NULL : strndup (ptr, len)) #define r_str_array(x,y) ((y >= 0 && y < (sizeof (x) / sizeof (*(x))))?(x)[(y)]: "") R_API RCharset *r_charset_new(void); R_API void r_charset_free(RCharset *charset);