| 213 |
{ |
{ |
| 214 |
if (errno == EINVAL) // Incomplete |
if (errno == EINVAL) // Incomplete |
| 215 |
{ |
{ |
| 216 |
|
#ifdef _DEBUG |
| 217 |
|
log_error("iconv(inbytes=%d, outbytes=%d) error: EINVAL\n", in_bytes, out_bytes); |
| 218 |
|
#endif |
| 219 |
*p_buf_len = (int)(p_buf + *p_buf_len - in_buf); |
*p_buf_len = (int)(p_buf + *p_buf_len - in_buf); |
| 220 |
*p_buf_offset = 0; |
*p_buf_offset = 0; |
| 221 |
*p_conv_len = (int)(conv_size - out_bytes); |
*p_conv_len = (int)(conv_size - out_bytes); |
| 232 |
{ |
{ |
| 233 |
if (in_bytes > out_bytes || out_bytes <= 0) |
if (in_bytes > out_bytes || out_bytes <= 0) |
| 234 |
{ |
{ |
| 235 |
errno = E2BIG; |
log_error("iconv(inbytes=%d, outbytes=%d) error: EILSEQ and E2BIG\n", in_bytes, out_bytes); |
| 236 |
return -1; |
return -2; |
| 237 |
} |
} |
| 238 |
|
|
| 239 |
*out_buf++ = *in_buf++; |
*out_buf = *in_buf; |
| 240 |
|
in_buf++; |
| 241 |
|
out_buf++; |
| 242 |
in_bytes--; |
in_bytes--; |
| 243 |
out_bytes--; |
out_bytes--; |
| 244 |
|
|