]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(__gconv): Always initialize cd->__data[last_step].__outbuf and
authorUlrich Drepper <drepper@redhat.com>
Fri, 26 Nov 1999 06:15:12 +0000 (06:15 +0000)
committerUlrich Drepper <drepper@redhat.com>
Fri, 26 Nov 1999 06:15:12 +0000 (06:15 +0000)
cd->__data[last_step].__outbufend.

iconv/gconv.c

index 14398e2e3751f566b24bbd9aa969bb06f0650230..16a6b8fb94ed9cf67cd0e9ab998d37b2161c074a 100644 (file)
@@ -27,8 +27,9 @@
 
 int
 internal_function
-__gconv (gconv_t cd, const unsigned char **inbuf, const unsigned char *inbufend,
-        unsigned char **outbuf, unsigned char *outbufend, size_t *converted)
+__gconv (gconv_t cd, const unsigned char **inbuf,
+        const unsigned char *inbufend, unsigned char **outbuf,
+        unsigned char *outbufend, size_t *converted)
 {
   size_t last_step = cd->nsteps - 1;
   int result;
@@ -39,6 +40,9 @@ __gconv (gconv_t cd, const unsigned char **inbuf, const unsigned char *inbufend,
   assert (converted != NULL);
   *converted = 0;
 
+  cd->data[last_step].outbuf = *outbuf;
+  cd->data[last_step].outbufend = outbufend;
+
   if (inbuf == NULL || *inbuf == NULL)
     /* We just flush.  */
     result = _CALL_DL_FCT (cd->steps->fct,
@@ -48,8 +52,6 @@ __gconv (gconv_t cd, const unsigned char **inbuf, const unsigned char *inbufend,
       const unsigned char *last_start;
 
       assert (outbuf != NULL && *outbuf != NULL);
-      cd->data[last_step].outbuf = *outbuf;
-      cd->data[last_step].outbufend = outbufend;
 
       do
        {