summaryrefslogtreecommitdiffstats
path: root/text-utils/column.c
diff options
context:
space:
mode:
authorSami Kerola2011-01-23 15:40:19 +0100
committerKarel Zak2011-01-25 10:40:36 +0100
commit395801be436760ab0fb16e9221559a64d6c64ba7 (patch)
treec06190c3f5328451f53c73db40ac1fe359fc9837 /text-utils/column.c
parentcfdisk: data type mismatch, and other, compiler warning fixes (diff)
downloadkernel-qcow2-util-linux-395801be436760ab0fb16e9221559a64d6c64ba7.tar.gz
kernel-qcow2-util-linux-395801be436760ab0fb16e9221559a64d6c64ba7.tar.xz
kernel-qcow2-util-linux-395801be436760ab0fb16e9221559a64d6c64ba7.zip
column: data type mismatch compiler warning fixes
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@iki.fi>
Diffstat (limited to 'text-utils/column.c')
-rw-r--r--text-utils/column.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/text-utils/column.c b/text-utils/column.c
index 5b52339f6..156de7059 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;
}