[PATCH 09/14] dmesg: avoid unnecessary variable assignment

Sami Kerola
2014-07-13T20:25:31Z

sys-utils/dmesg.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sys-utils/dmesg.c b/sys-utils/dmesg.c
index 147a3ff..f95609f 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;
--
2.0.1