From 6fe0c0153b924bba12b0824c835d8a1243eff67a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reimar=20D=C3=B6ffinger?= Date: Wed, 25 Jul 2018 22:24:25 +0200 Subject: [PATCH] Simplify and avoid uninitialized variable compiler warning. --- iec16022ecc200.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/iec16022ecc200.c b/iec16022ecc200.c index e74beb9..aa231d5 100644 --- a/iec16022ecc200.c +++ b/iec16022ecc200.c @@ -256,9 +256,9 @@ static char ecc200encode(unsigned char *t, int tl, const unsigned char *s, int s { char out[6]; int p = 0; - const char *e, - *s2 = "!\"#$%&'()*+,-./:;<=>?@[\\]^_", - *s3 = 0; + const char *e = " 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\r*>"; // for X12 + const char *s2 = "!\"#$%&'()*+,-./:;<=>?@[\\]^_"; + const char *s3 = 0; if (newenc == 'c') { e = " 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; s3 = "`abcdefghijklmnopqrstuvwxyz{|}~\177"; @@ -267,8 +267,6 @@ static char ecc200encode(unsigned char *t, int tl, const unsigned char *s, int s e = " 0123456789abcdefghijklmnopqrstuvwxyz"; s3 = "`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~\177"; } - if (newenc == 'x') - e = " 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\r*>"; do { unsigned char c = s[sp++]; char *w;