[PATCH 2/2] column: data type mismatch compiler warning fixes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Following warnings will longer appear when one will compile with
gcc flags -Wall -Wextra -pedantic

column.c:364:2: warning: comparison of unsigned expression < 0 is always false
column.c:369:2: warning: comparison of unsigned expression < 0 is always false

Signed-off-by: Sami Kerola <kerolasa@xxxxxx>
---
 text-utils/column.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/text-utils/column.c b/text-utils/column.c
index 5b52339..156de70 100644
--- a/text-utils/column.c
+++ b/text-utils/column.c
@@ -357,7 +357,7 @@ input(fp)
 #ifdef HAVE_WIDECHAR
 static wchar_t *mbs_to_wcs(const char *s)
 {
-	size_t n;
+	ssize_t n;
 	wchar_t *wcs;
 
 	n = mbstowcs((wchar_t *)0, s, 0);
@@ -366,7 +366,8 @@ static wchar_t *mbs_to_wcs(const char *s)
 	wcs = malloc((n + 1) * sizeof(wchar_t));
 	if (!wcs)
 		return NULL;
-	if (mbstowcs(wcs, s, n + 1) < 0)
+	n = mbstowcs(wcs, s, n + 1);
+	if (n < 0)
 		return NULL;
 	return wcs;
 }
-- 
1.7.3.5

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux