[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/3] nfkc.c: Fixed invalid variable types and invalid pointer cas
From: |
Karlson2k |
Subject: |
[PATCH 1/3] nfkc.c: Fixed invalid variable types and invalid pointer casting. |
Date: |
Mon, 4 Apr 2016 15:29:49 +0300 |
---
lib/nfkc.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/lib/nfkc.c b/lib/nfkc.c
index dbdf41b..feb4844 100644
--- a/lib/nfkc.c
+++ b/lib/nfkc.c
@@ -462,13 +462,13 @@ g_utf8_to_ucs4_fast (const gchar * str, gssize len, gsize
* items_written)
**/
static gchar *
g_ucs4_to_utf8 (const gunichar * str,
- glong len,
- glong * items_read, glong * items_written)
+ gssize len,
+ gsize * items_read, gsize * items_written)
{
- gint result_length;
+ gsize result_length;
gchar *result = NULL;
gchar *p;
- gint i;
+ gsize i;
result_length = 0;
for (i = 0; len < 0 || i < len; i++)
@@ -1035,8 +1035,7 @@ char *
stringprep_ucs4_to_utf8 (const uint32_t * str, ssize_t len,
size_t * items_read, size_t * items_written)
{
- return g_ucs4_to_utf8 (str, len, (glong *) items_read,
- (glong *) items_written);
+ return g_ucs4_to_utf8 (str, len, items_read, items_written);
}
/**
--
2.8.0.windows.1
- [PATCH 0/3] Series of fixes for Win x64, Karlson2k, 2016/04/04
- [PATCH 1/3] nfkc.c: Fixed invalid variable types and invalid pointer casting.,
Karlson2k <=
- [PATCH 3/3] nfkc.c: reuse internally calculated lengths for buffer overrun protection, adjust internal API to public API: use ether string length OR null-termination, and do not stop processing on null char if length is specified., Karlson2k, 2016/04/04
- [PATCH 2/3] nfkc.c: int/size_t fixes in find_decomposition(), Karlson2k, 2016/04/04
- [PATCH v2 0/4] Crash fixed on Win x64, Karlson2k, 2016/04/04
- [PATCH v2 4/4] nfkc.c: reuse internally calculated lengths for buffer overrun protection, adjust internal API to public API: use ether string length OR null-termination, and do not stop processing on null char if length is specified., Karlson2k, 2016/04/04
- [PATCH v2 1/4] nfkc.c: Fix incorrect "items_written" returned by stringprep_utf8_to_ucs4() on platforms with sizeof(size_t) != sizeof(long) (i.e. Win x64). Also fixed crash in various function which use value of "items_written" (like tld_check_8z(), tld_check_lz()), Karlson2k, 2016/04/04
- [PATCH v2 3/4] nfkc.c: int/size_t fixes in find_decomposition(), Karlson2k, 2016/04/04
- [PATCH v2 2/4] nfkc.c: Fixed invalid variable types and invalid pointer casting., Karlson2k, 2016/04/04