cp_mbstowcs: check functions return zero on success.

This commit is contained in:
Uwe Bonnes 2000-06-15 00:31:12 +00:00 committed by Alexandre Julliard
parent 594a0dccce
commit 31142f83f7
1 changed files with 2 additions and 2 deletions

View File

@ -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 );