diff --git a/libr/include/r_util/r_str.h b/libr/include/r_util/r_str.h index 0e336a1971238..7bda3a9a7bdf2 100644 --- a/libr/include/r_util/r_str.h +++ b/libr/include/r_util/r_str.h @@ -38,8 +38,8 @@ R_API bool r_str_range_in(const char *r, ut64 addr); R_API int r_str_len_utf8(const char *s); R_API int r_str_len_utf8char(const char *s, int left); R_API void r_str_filter_zeroline(char *str, int len); -R_API int r_str_utf8_codepoint (char* s, int left); -R_API bool r_str_char_fullwidth (char* s, int left); +R_API int r_str_utf8_codepoint (const char* s, int left); +R_API bool r_str_char_fullwidth (const char* s, int left); R_API int r_str_write(int fd, const char *b); R_API void r_str_ncpy(char *dst, const char *src, int n); R_API void r_str_sanitize(char *c); diff --git a/libr/util/str.c b/libr/util/str.c index bafb177e504ae..4ec7ecd211302 100644 --- a/libr/util/str.c +++ b/libr/util/str.c @@ -1600,7 +1600,7 @@ R_API char *r_str_ansi_crop(const char *str, ut32 x, ut32 y, ut32 x2, ut32 y2) { return ret; } -R_API int r_str_utf8_codepoint (char* s, int left) { +R_API int r_str_utf8_codepoint (const char* s, int left) { bool safe = left >= 0; if ((*s & 0x80) != 0x80) { return 0; @@ -1614,7 +1614,7 @@ R_API int r_str_utf8_codepoint (char* s, int left) { return 0; } -R_API bool r_str_char_fullwidth (char* s, int left) { +R_API bool r_str_char_fullwidth (const char* s, int left) { int codepoint = r_str_utf8_codepoint (s, left); return (codepoint >= 0x1100 && (codepoint <= 0x115f || /* Hangul Jamo init. consonants */