From 53fa8b2a4bbb589d3d761284c70f93e0f852df23 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Mon, 16 Feb 2015 09:40:12 +0200 Subject: Fixed few compiler warnings. --- Modules/cjkcodecs/_codecs_iso2022.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'Modules/cjkcodecs') diff --git a/Modules/cjkcodecs/_codecs_iso2022.c b/Modules/cjkcodecs/_codecs_iso2022.c index 5c401aaf8e..1ce4218f30 100644 --- a/Modules/cjkcodecs/_codecs_iso2022.c +++ b/Modules/cjkcodecs/_codecs_iso2022.c @@ -292,7 +292,7 @@ iso2022processesc(const void *config, MultibyteCodec_State *state, const unsigned char **inbuf, Py_ssize_t *inleft) { unsigned char charset, designation; - Py_ssize_t i, esclen; + Py_ssize_t i, esclen = 0; for (i = 1;i < MAX_ESCSEQLEN;i++) { if (i >= *inleft) @@ -307,10 +307,9 @@ iso2022processesc(const void *config, MultibyteCodec_State *state, } } - if (i >= MAX_ESCSEQLEN) - return 1; /* unterminated escape sequence */ - switch (esclen) { + case 0: + return 1; /* unterminated escape sequence */ case 3: if (INBYTE2 == '$') { charset = INBYTE3 | CHARSET_DBCS; -- cgit v1.2.1