summaryrefslogtreecommitdiff
path: root/iconv/gconv_simple.c
diff options
context:
space:
mode:
Diffstat (limited to 'iconv/gconv_simple.c')
-rw-r--r--iconv/gconv_simple.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/iconv/gconv_simple.c b/iconv/gconv_simple.c
index fbdac832e0..35346aa498 100644
--- a/iconv/gconv_simple.c
+++ b/iconv/gconv_simple.c
@@ -489,12 +489,15 @@ internal_ucs4le_loop_unaligned (struct __gconv_step *step,
# endif
/* Determine the status. */
- if (*inptrp + 4 > inend)
+ if (*inptrp == inend)
result = __GCONV_EMPTY_INPUT;
- else if (*outptrp + 4 > outend)
- result = __GCONV_FULL_OUTPUT;
- else
+ else if (*inptrp + 4 > inend)
result = __GCONV_INCOMPLETE_INPUT;
+ else
+ {
+ assert (*outptrp + 4 > outend);
+ result = __GCONV_FULL_OUTPUT;
+ }
return result;
}
@@ -609,10 +612,13 @@ ucs4le_internal_loop (struct __gconv_step *step,
/* Determine the status. */
if (*inptrp == inend)
result = __GCONV_EMPTY_INPUT;
- else if (*outptrp + 4 > outend)
- result = __GCONV_FULL_OUTPUT;
- else
+ else if (*inptrp + 4 > inend)
result = __GCONV_INCOMPLETE_INPUT;
+ else
+ {
+ assert (*outptrp + 4 > outend);
+ result = __GCONV_FULL_OUTPUT;
+ }
return result;
}
@@ -678,10 +684,13 @@ ucs4le_internal_loop_unaligned (struct __gconv_step *step,
/* Determine the status. */
if (*inptrp == inend)
result = __GCONV_EMPTY_INPUT;
- else if (*outptrp + 4 > outend)
- result = __GCONV_FULL_OUTPUT;
- else
+ else if (*inptrp + 4 > inend)
result = __GCONV_INCOMPLETE_INPUT;
+ else
+ {
+ assert (*outptrp + 4 > outend);
+ result = __GCONV_FULL_OUTPUT;
+ }
return result;
}