diff --git a/src/internal/pe_impl.c b/src/internal/pe_impl.c index 3edbe16..2c4e5c9 100644 --- a/src/internal/pe_impl.c +++ b/src/internal/pe_impl.c @@ -26,16 +26,16 @@ int32_t pe_impl_strlen_ansi(const char * str) int32_t pe_impl_strlen_utf16(const wchar16_t * str) { - wchar16_t * wch; - wchar16_t * upper_bound; + const wchar16_t * wch; + const wchar16_t * upper_bound; - /* sanity check */ - upper_bound = (wchar16_t *)str + PE_STR_MAX_SYMBOL_LEN_ALLOWED; + upper_bound = str + PE_STR_MAX_SYMBOL_LEN_ALLOWED; - for (wch = (wchar16_t *)str; (wch < upper_bound) && (*wch); wch++); + for (wch=str; *wch && wch