mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 16:12:58 +00:00
Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys.
This commit is contained in:
parent
b94e2d8ca0
commit
c2c66aff7d
24198 changed files with 0 additions and 37285 deletions
36
sdk/lib/crt/string/_mbsnlen.c
Normal file
36
sdk/lib/crt/string/_mbsnlen.c
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS CRT
|
||||
* PURPOSE: Implementation of _mbsnlen
|
||||
* FILE: lib/sdk/crt/string/_mbsnlen.c
|
||||
* PROGRAMMER: Timo Kreuzer
|
||||
*/
|
||||
|
||||
#include <mbstring.h>
|
||||
|
||||
_Check_return_
|
||||
_CRTIMP
|
||||
size_t
|
||||
__cdecl
|
||||
_mbsnlen(
|
||||
_In_z_ const unsigned char *pmbstr,
|
||||
_In_ size_t cjMaxLen)
|
||||
{
|
||||
size_t cchCount = 0;
|
||||
unsigned char jMbsByte;
|
||||
|
||||
/* Loop while we have bytes to process */
|
||||
while (cjMaxLen-- > 0)
|
||||
{
|
||||
/* Get next mb byte */
|
||||
jMbsByte = *pmbstr++;
|
||||
|
||||
/* If this is 0, we're done */
|
||||
if (jMbsByte == 0) break;
|
||||
|
||||
/* Don't count lead bytes */
|
||||
if (!_ismbblead(jMbsByte)) cchCount++;
|
||||
}
|
||||
|
||||
return cchCount;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue