X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=gnu%2Fmbrtowc.c;h=e49d55b3b1037dfdd7cab83f9be98fe8aa53ec56;hb=d30babc23b4f25be970ada2e63a50220a3672281;hp=50e37b9754094fb1e1abe0831dcf57f3532f3e74;hpb=4aa85f09e755fc827cd5ab6225f20c83cd42245d;p=debian%2Ftar diff --git a/gnu/mbrtowc.c b/gnu/mbrtowc.c index 50e37b97..e49d55b3 100644 --- a/gnu/mbrtowc.c +++ b/gnu/mbrtowc.c @@ -1,7 +1,5 @@ -/* -*- buffer-read-only: t -*- vi: set ro: */ -/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ /* Convert multibyte character to wide character. - Copyright (C) 1999-2002, 2005-2014 Free Software Foundation, Inc. + Copyright (C) 1999-2002, 2005-2015 Free Software Foundation, Inc. Written by Bruno Haible , 2008. This program is free software: you can redistribute it and/or modify @@ -330,7 +328,7 @@ mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps) size_t rpl_mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps) { -# if MBRTOWC_NULL_ARG2_BUG || MBRTOWC_RETVAL_BUG +# if MBRTOWC_NULL_ARG2_BUG || MBRTOWC_RETVAL_BUG || MBRTOWC_EMPTY_INPUT_BUG if (s == NULL) { pwc = NULL; @@ -339,6 +337,11 @@ rpl_mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps) } # endif +# if MBRTOWC_EMPTY_INPUT_BUG + if (n == 0) + return (size_t) -2; +# endif + # if MBRTOWC_RETVAL_BUG { static mbstate_t internal_state;