don't use uninitialized variable ('chlenbak').

the problem reported by Markus Illenseer on tech-userlevel@
and analyzed by enami tsugutomo.
This commit is contained in:
yamt 2003-10-14 12:50:03 +00:00
parent 162ada1c8b
commit faf00d99a2
1 changed files with 4 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: citrus_euctw.c,v 1.7 2003/06/26 12:09:57 tshiozak Exp $ */
/* $NetBSD: citrus_euctw.c,v 1.8 2003/10/14 12:50:03 yamt Exp $ */
/*-
* Copyright (c)2002 Citrus Project,
@ -56,7 +56,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: citrus_euctw.c,v 1.7 2003/06/26 12:09:57 tshiozak Exp $");
__RCSID("$NetBSD: citrus_euctw.c,v 1.8 2003/10/14 12:50:03 yamt Exp $");
#endif /* LIBC_SCCS and not lint */
#include <assert.h>
@ -214,6 +214,8 @@ _citrus_EUCTW_mbrtowc_priv(_EUCTWEncodingInfo * __restrict ei,
return (0);
}
chlenbak = psenc->chlen;
/* make sure we have the first byte in the buffer */
switch (psenc->chlen) {
case 0: