summaryrefslogtreecommitdiff
path: root/iconv/gconv.c
diff options
context:
space:
mode:
Diffstat (limited to 'iconv/gconv.c')
-rw-r--r--iconv/gconv.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/iconv/gconv.c b/iconv/gconv.c
index 88d76056c8..7cb78694e0 100644
--- a/iconv/gconv.c
+++ b/iconv/gconv.c
@@ -1,6 +1,6 @@
/* Convert characters in input buffer using conversion descriptor to
output buffer.
- Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -31,12 +31,14 @@ __gconv (__gconv_t cd, const unsigned char **inbuf,
const unsigned char *inbufend, unsigned char **outbuf,
unsigned char *outbufend, size_t *irreversible)
{
- size_t last_step = cd->__nsteps - 1;
+ size_t last_step;
int result;
if (cd == (__gconv_t) -1L)
return __GCONV_ILLEGAL_DESCRIPTOR;
+ last_step = cd->__nsteps - 1;
+
assert (irreversible != NULL);
*irreversible = 0;