mirror of
https://github.com/reactos/reactos.git
synced 2025-05-23 11:04:52 +00:00

Imported from https://www.nuget.org/packages/Microsoft.Windows.SDK.CRTSource/10.0.22621.3 License: MIT
24 lines
488 B
C++
24 lines
488 B
C++
//
|
|
// wcsncnt.cpp
|
|
//
|
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
//
|
|
// Defines __wcsncnt(), which returns the number of characters in a string. If
|
|
// the string is longer than the given 'count', 'count' is returned.
|
|
//
|
|
#include <string.h>
|
|
|
|
|
|
|
|
extern "C" size_t __cdecl __wcsncnt(
|
|
wchar_t const* const string,
|
|
size_t const count
|
|
)
|
|
{
|
|
wchar_t const* it = string;
|
|
size_t n = 0;
|
|
|
|
for (; *it && n != count; ++it, ++n) { }
|
|
|
|
return n;
|
|
}
|