summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2015-08-03 08:43:10 +0300
committermidipix <writeonce@midipix.org>2015-09-26 11:10:13 -0400
commit8860e903f5d0782e050d78725aadedeb8dad9a0c (patch)
treec68deae9f255eaba8ac6884a731dc765ca420161
parentee0bd46d1e2f157f5eb54ca6d506d61dc6feea9d (diff)
downloadpemagine-8860e903f5d0782e050d78725aadedeb8dad9a0c.tar.bz2
pemagine-8860e903f5d0782e050d78725aadedeb8dad9a0c.tar.xz
pe_impl_strlen_ansi: fix internal error reporting via signedness.
-rw-r--r--src/exports/pe_get_export_symbol_info.c2
-rw-r--r--src/internal/pe_impl.c4
-rw-r--r--src/internal/pe_impl.h4
3 files changed, 5 insertions, 5 deletions
diff --git a/src/exports/pe_get_export_symbol_info.c b/src/exports/pe_get_export_symbol_info.c
index 9f00634..4f9f5c6 100644
--- a/src/exports/pe_get_export_symbol_info.c
+++ b/src/exports/pe_get_export_symbol_info.c
@@ -23,7 +23,7 @@ int pe_get_export_symbol_info(
{
struct pe_export_hdr * exp_hdr;
- size_t len;
+ ssize_t len;
uint32_t * rva_offset;
uintptr_t * addr_offset;
diff --git a/src/internal/pe_impl.c b/src/internal/pe_impl.c
index 2611f6b..594f23d 100644
--- a/src/internal/pe_impl.c
+++ b/src/internal/pe_impl.c
@@ -8,7 +8,7 @@
#include <pemagine/pemagine.h>
#include "pe_impl.h"
-uint32_t pe_impl_strlen_ansi(const char * str)
+int32_t pe_impl_strlen_ansi(const char * str)
{
char * ch;
char * upper_bound;
@@ -25,7 +25,7 @@ uint32_t pe_impl_strlen_ansi(const char * str)
}
-uint32_t pe_impl_strlen_utf16(const wchar16_t * str)
+int32_t pe_impl_strlen_utf16(const wchar16_t * str)
{
wchar16_t * wch;
wchar16_t * upper_bound;
diff --git a/src/internal/pe_impl.h b/src/internal/pe_impl.h
index 392f6b2..43ec6ef 100644
--- a/src/internal/pe_impl.h
+++ b/src/internal/pe_impl.h
@@ -12,6 +12,6 @@ struct pe_block {
uint32_t size;
};
-uint32_t pe_impl_strlen_ansi(const char * str);
-uint32_t pe_impl_strlen_utf16(const wchar16_t * str);
+int32_t pe_impl_strlen_ansi(const char * str);
+int32_t pe_impl_strlen_utf16(const wchar16_t * str);
wchar16_t pe_impl_utf16_char_to_lower(const wchar16_t c);