version 1.1.1.1, 2012/02/21 22:57:48
|
version 1.1.1.2, 2012/05/29 09:29:43
|
Line 1
|
Line 1
|
/* Copyright (C) 1999-2001, 2003 Bruno Haible. | /* Copyright (C) 1999-2001, 2003, 2011 Bruno Haible. |
This file is not part of the GNU LIBICONV Library. |
This file is not part of the GNU LIBICONV Library. |
This file is put into the public domain. */ |
This file is put into the public domain. */ |
|
|
Line 76 int iconv_string (const char* tocode, const char* from
|
Line 76 int iconv_string (const char* tocode, const char* from
|
size_t outsize = tmpbufsize; |
size_t outsize = tmpbufsize; |
size_t res = iconv(cd,&inptr,&insize,&outptr,&outsize); |
size_t res = iconv(cd,&inptr,&insize,&outptr,&outsize); |
if (res == (size_t)(-1) && errno != E2BIG) { |
if (res == (size_t)(-1) && errno != E2BIG) { |
if (errno == EINVAL) | int saved_errno = (errno == EINVAL ? EILSEQ : errno); |
break; | iconv_close(cd); |
else { | errno = saved_errno; |
int saved_errno = errno; | return -1; |
iconv_close(cd); | |
errno = saved_errno; | |
return -1; | |
} | |
} |
} |
count += outptr-tmpbuf; |
count += outptr-tmpbuf; |
} |
} |