summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorSami Kerola2013-04-08 21:32:49 +0200
committerKarel Zak2013-04-09 12:17:20 +0200
commit3acc206d39de38f7d78008950cd030fceb125ff0 (patch)
treec66b0823e6c132d4b80f9f90133fa4e63f3f146c /lib
parentbash-completion: swapon: add options and fix argument (diff)
downloadkernel-qcow2-util-linux-3acc206d39de38f7d78008950cd030fceb125ff0.tar.gz
kernel-qcow2-util-linux-3acc206d39de38f7d78008950cd030fceb125ff0.tar.xz
kernel-qcow2-util-linux-3acc206d39de38f7d78008950cd030fceb125ff0.zip
various: fix variable and function declarations [smatch scan]
disk-utils/fsck.minix.c:511:9: warning: mixing declarations and code fdisks/sfdisk.c:982:5: warning: mixing declarations and code fdisks/sfdisk.c:1254:5: warning: mixing declarations and code fdisks/sfdisk.c:1564:5: warning: mixing declarations and code lib/mbsalign.c:279:7: warning: mixing declarations and code libblkid/src/devname.c:378:17: warning: mixing declarations and code libfdisk/src/alignment.c:219:9: warning: mixing declarations and code term-utils/wall.c:111:9: warning: mixing declarations and code text-utils/col.c:418:19: warning: non-ANSI function declaration of function 'flush_blanks' text-utils/col.c:553:12: warning: non-ANSI function declaration of function 'alloc_line' text-utils/rev.c:105:9: warning: mixing declarations and code text-utils/tailf.c:245:9: warning: mixing declarations and code Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'lib')
-rw-r--r--lib/mbsalign.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/mbsalign.c b/lib/mbsalign.c
index 05c46509a..e420fea66 100644
--- a/lib/mbsalign.c
+++ b/lib/mbsalign.c
@@ -173,7 +173,7 @@ mbsalign (const char *src, char *dest, size_t dest_size,
const char *str_to_print = src;
size_t n_cols = src_size - 1;
size_t n_used_bytes = n_cols; /* Not including NUL */
- size_t n_spaces = 0;
+ size_t n_spaces = 0, space_left;
bool conversion = false;
bool wc_enabled = false;
@@ -276,7 +276,7 @@ mbsalign_unibyte:
}
dest = mbs_align_pad (dest, dest_end, start_spaces);
- size_t space_left = dest_end - dest;
+ space_left = dest_end - dest;
dest = mempcpy (dest, str_to_print, min (n_used_bytes, space_left));
mbs_align_pad (dest, dest_end, end_spaces);
}