summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSami Kerola <kerolasa@iki.fi>2011-01-23 15:40:18 +0100
committerKarel Zak <kzak@redhat.com>2011-01-25 10:40:34 +0100
commit2897f29a10ba95a96af2139b982ddaddfd49a60d (patch)
tree2faad79af0ca5a6708e17b18075e20acbd940ad9 /lib
parent5a669b12f84f85f7ace13712b20ce9592a08f157 (diff)
downloadutil-linux-old-2897f29a10ba95a96af2139b982ddaddfd49a60d.tar.gz
cfdisk: data type mismatch, and other, compiler warning fixes
Following warnings will longer appear when one will compile with gcc flags -Wall -Wextra -pedantic cfdisk.c:475:3: warning: comparison of unsigned expression < 0 is always false cfdisk.c:487:16: warning: comparison between signed and unsigned integer expressions cfdisk.c:492:14: warning: comparison between signed and unsigned integer expressions cfdisk.c:565:19: warning: comparison between signed and unsigned integer expressions cfdisk.c:569:19: warning: comparison between signed and unsigned integer expressions cfdisk.c:1070:14: warning: comparison between signed and unsigned integer expressions cfdisk.c:1568:5: warning: missing initializer cfdisk.c:1568:5: warning: (near initialization for 'tmp_ext.volume_label') mbsalign.c:131:2: warning: comparison of unsigned expression >= 0 is always true Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'lib')
-rw-r--r--lib/mbsalign.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/mbsalign.c b/lib/mbsalign.c
index 82ffc09c..468e35b5 100644
--- a/lib/mbsalign.c
+++ b/lib/mbsalign.c
@@ -106,12 +106,12 @@ rpl_wcswidth (const wchar_t *s, size_t n)
size_t
mbs_truncate(char *str, size_t *width)
{
- size_t bytes = strlen(str);
+ ssize_t bytes = strlen(str);
#ifdef HAVE_WIDECHAR
- size_t sz = mbstowcs(NULL, str, 0);
+ ssize_t sz = mbstowcs(NULL, str, 0);
wchar_t *wcs = NULL;
- if (sz == (size_t) -1)
+ if (sz == (ssize_t) -1)
goto done;
wcs = malloc((sz + 1) * sizeof(wchar_t));