summaryrefslogtreecommitdiffstats
path: root/sys-utils/dmesg.c
diff options
context:
space:
mode:
authorSami Kerola2014-07-13 18:42:08 +0200
committerSami Kerola2014-07-13 19:35:38 +0200
commitd9bdd89db1ae0e35d31adf0a21ed9c8e5badf0cf (patch)
treeac36d0a1f5c0680719b0e20ec82da92de4c1191f /sys-utils/dmesg.c
parentfdisk: avoid code duplication (diff)
downloadkernel-qcow2-util-linux-d9bdd89db1ae0e35d31adf0a21ed9c8e5badf0cf.tar.gz
kernel-qcow2-util-linux-d9bdd89db1ae0e35d31adf0a21ed9c8e5badf0cf.tar.xz
kernel-qcow2-util-linux-d9bdd89db1ae0e35d31adf0a21ed9c8e5badf0cf.zip
dmesg: avoid unnecessary variable assignment
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'sys-utils/dmesg.c')
-rw-r--r--sys-utils/dmesg.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys-utils/dmesg.c b/sys-utils/dmesg.c
index 147a3ff70..f95609f2d 100644
--- a/sys-utils/dmesg.c
+++ b/sys-utils/dmesg.c
@@ -612,7 +612,7 @@ static void safe_fwrite(const char *buf, size_t size, FILE *out)
for (i = 0; i < size; i++) {
const char *p = buf + i;
int rc, hex = 0;
- size_t len = 1;
+ size_t len;
#ifdef HAVE_WIDECHAR
wchar_t wc;
@@ -629,6 +629,7 @@ static void safe_fwrite(const char *buf, size_t size, FILE *out)
}
i += len - 1;
#else
+ len = 1;
if (!isprint((unsigned int) *p) &&
!isspace((unsigned int) *p)) /* non-printable */
hex = 1;