From 4875a15ca61358a1c95b156b2279fce092451278 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Wed, 19 Jan 2022 00:45:43 +0100 Subject: Update libNX_X11 to upstream's libX11-1.7.3.1-10-gd60ede78 --- nx-X11/lib/src/xlibi18n/lcPrTxt.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'nx-X11/lib/src/xlibi18n/lcPrTxt.c') diff --git a/nx-X11/lib/src/xlibi18n/lcPrTxt.c b/nx-X11/lib/src/xlibi18n/lcPrTxt.c index e62e94e80..047eb7f7a 100644 --- a/nx-X11/lib/src/xlibi18n/lcPrTxt.c +++ b/nx-X11/lib/src/xlibi18n/lcPrTxt.c @@ -30,6 +30,7 @@ #include "XlcPubI.h" #include #include +#include "reallocarray.h" static XPointer * alloc_list( @@ -40,11 +41,11 @@ alloc_list( if (is_wide_char) { wchar_t **wstr_list; - wstr_list = Xmalloc(count * sizeof(wchar_t *)); + wstr_list = Xmallocarray(count, sizeof(wchar_t *)); if (wstr_list == NULL) return (XPointer *) NULL; - *wstr_list = Xmalloc(nitems * sizeof(wchar_t)); + *wstr_list = Xmallocarray(nitems, sizeof(wchar_t)); if (*wstr_list == NULL) { Xfree(wstr_list); return (XPointer *) NULL; @@ -54,7 +55,7 @@ alloc_list( } else { char **str_list; - str_list = Xmalloc(count * sizeof(char *)); + str_list = Xmallocarray(count, sizeof(char *)); if (str_list == NULL) return (XPointer *) NULL; @@ -99,7 +100,7 @@ copy_list( for (str = *str_list; count > 0; count--, str_list++) { strcpy(str, mb_text); *str_list = str; - length = strlen(str) + 1; + length = (int) strlen(str) + 1; str += length; mb_text += length; } @@ -185,7 +186,7 @@ _XTextPropertyToTextList( if (do_strcpy) { len = min(from_left, to_left); - strncpy(to, from, len); + strncpy(to, from, (size_t) len); from += len; to += len; from_left -= len; -- cgit v1.2.3