cp_mbstowcs: check functions return zero on success.
This commit is contained in:
parent
594a0dccce
commit
31142f83f7
|
@ -149,7 +149,7 @@ int cp_mbstowcs( const union cptable *table, int flags,
|
||||||
{
|
{
|
||||||
if (flags & MB_ERR_INVALID_CHARS)
|
if (flags & MB_ERR_INVALID_CHARS)
|
||||||
{
|
{
|
||||||
if (!check_invalid_chars_sbcs( &table->sbcs, src, srclen )) return -2;
|
if (check_invalid_chars_sbcs( &table->sbcs, src, srclen )) return -2;
|
||||||
}
|
}
|
||||||
if (!dstlen) return srclen;
|
if (!dstlen) return srclen;
|
||||||
return mbstowcs_sbcs( &table->sbcs, src, srclen, dst, dstlen );
|
return mbstowcs_sbcs( &table->sbcs, src, srclen, dst, dstlen );
|
||||||
|
@ -158,7 +158,7 @@ int cp_mbstowcs( const union cptable *table, int flags,
|
||||||
{
|
{
|
||||||
if (flags & MB_ERR_INVALID_CHARS)
|
if (flags & MB_ERR_INVALID_CHARS)
|
||||||
{
|
{
|
||||||
if (!check_invalid_chars_dbcs( &table->dbcs, src, srclen )) return -2;
|
if (check_invalid_chars_dbcs( &table->dbcs, src, srclen )) return -2;
|
||||||
}
|
}
|
||||||
if (!dstlen) return get_length_dbcs( &table->dbcs, src, srclen );
|
if (!dstlen) return get_length_dbcs( &table->dbcs, src, srclen );
|
||||||
return mbstowcs_dbcs( &table->dbcs, src, srclen, dst, dstlen );
|
return mbstowcs_dbcs( &table->dbcs, src, srclen, dst, dstlen );
|
||||||
|
|
Loading…
Reference in New Issue