projects
/
platform
/
upstream
/
glib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Imported Upstream version 2.66.6
[platform/upstream/glib.git]
/
gio
/
giowin32-private.c
diff --git
a/gio/giowin32-private.c
b/gio/giowin32-private.c
index
7120ae0
..
47e8408
100644
(file)
--- a/
gio/giowin32-private.c
+++ b/
gio/giowin32-private.c
@@
-16,11
+16,12
@@
* along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
* along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
+#include "gstrfuncsprivate.h"
-static gs
s
ize
+static gsize
g_utf16_len (const gunichar2 *str)
{
g_utf16_len (const gunichar2 *str)
{
- gs
s
ize result;
+ gsize result;
for (result = 0; str[0] != 0; str++, result++)
;
for (result = 0; str[0] != 0; str++, result++)
;
@@
-31,17
+32,20
@@
g_utf16_len (const gunichar2 *str)
static gunichar2 *
g_wcsdup (const gunichar2 *str, gssize str_len)
{
static gunichar2 *
g_wcsdup (const gunichar2 *str, gssize str_len)
{
- gssize str_size;
+ gsize str_len_unsigned;
+ gsize str_size;
g_return_val_if_fail (str != NULL, NULL);
g_return_val_if_fail (str != NULL, NULL);
- if (str_len == -1)
- str_len = g_utf16_len (str);
+ if (str_len < 0)
+ str_len_unsigned = g_utf16_len (str);
+ else
+ str_len_unsigned = (gsize) str_len;
- g_assert (str_len <= G_MAXSIZE / sizeof (gunichar2) - 1);
- str_size = (str_len + 1) * sizeof (gunichar2);
+ g_assert (str_len
_unsigned
<= G_MAXSIZE / sizeof (gunichar2) - 1);
+ str_size = (str_len
_unsigned
+ 1) * sizeof (gunichar2);
- return g_memdup (str, str_size);
+ return g_memdup
2
(str, str_size);
}
static const gunichar2 *
}
static const gunichar2 *