summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRuediger Meier2017-06-17 22:40:41 +0200
committerRuediger Meier2017-06-29 14:04:25 +0200
commitc3ae7854337be9f49540f4b0fb465ee4bd77a5ee (patch)
tree42f548a631f83341e3fc5ec3d5d057cff8594396 /lib
parentlscpu: make clang analyzer happy (diff)
downloadkernel-qcow2-util-linux-c3ae7854337be9f49540f4b0fb465ee4bd77a5ee.tar.gz
kernel-qcow2-util-linux-c3ae7854337be9f49540f4b0fb465ee4bd77a5ee.tar.xz
kernel-qcow2-util-linux-c3ae7854337be9f49540f4b0fb465ee4bd77a5ee.zip
misc: avoid some dead initialization warnings
Clang analyzer warnings: Dead store, Dead initialization: lib/mbsedit.c:154:8: warning: Value stored to 'in' during its initialization is never read char *in = (char *) &c; ^~ ~~~~~~~~~~~ misc-utils/findmnt-verify.c:129:14: warning: Value stored to 'cn' during its initialization is never read const char *cn = tgt; ^~ ~~~ Dead store, Dead increment: sys-utils/hwclock.c:1461:2: warning: Value stored to 'argv' is never read argv += optind; ^ ~~~~~~ Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'lib')
-rw-r--r--lib/mbsedit.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/mbsedit.c b/lib/mbsedit.c
index d464358fc..e028c496d 100644
--- a/lib/mbsedit.c
+++ b/lib/mbsedit.c
@@ -151,7 +151,7 @@ static size_t mbs_insert(char *str, wint_t c, size_t *ncells)
{
/* all in bytes! */
size_t n = 1, bytes;
- char *in = (char *) &c;
+ char *in;
#ifdef HAVE_WIDECHAR
wchar_t wc = (wchar_t) c;
@@ -162,6 +162,7 @@ static size_t mbs_insert(char *str, wint_t c, size_t *ncells)
in = in_buf;
#else
*ncells = 1;
+ in = (char *) &c;
#endif
bytes = strlen(str);