(PREPARE_LOOP): Return __GCONV_EMPTY_INPUT only if input is really
[kopensolaris-gnu/glibc.git] / iconvdata / unicode.c
index c88f75d..df452d2 100644 (file)
@@ -49,7 +49,8 @@
        {                                                                     \
          /* We have to find out which byte order the file is encoded in.  */ \
          if (inptr + 2 > inend)                                              \
-           return __GCONV_EMPTY_INPUT;                                       \
+           return (inptr == inend                                            \
+                   ? __GCONV_EMPTY_INPUT : __GCONV_INCOMPLETE_INPUT);        \
                                                                              \
          if (get16u (inptr) == BOM)                                          \
            /* Simply ignore the BOM character.  */                           \