Update stpcpy(3) and wcpcpy(3) to current coding conventions.
This commit is contained in:
parent
9d3bf0f164
commit
163ecfcf55
|
@ -1,6 +1,6 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
|
|
||||||
Copyright(C) Jonas 'Sortie' Termansen 2011, 2012.
|
Copyright(C) Jonas 'Sortie' Termansen 2011, 2012, 2014.
|
||||||
|
|
||||||
This file is part of the Sortix C Library.
|
This file is part of the Sortix C Library.
|
||||||
|
|
||||||
|
@ -26,8 +26,9 @@
|
||||||
|
|
||||||
extern "C" char* stpcpy(char* dest, const char* src)
|
extern "C" char* stpcpy(char* dest, const char* src)
|
||||||
{
|
{
|
||||||
while ( *src )
|
size_t index;
|
||||||
*dest++ = *src++;
|
for ( index = 0; src[index]; index++ )
|
||||||
*dest = '\0';
|
dest[index] = src[index];
|
||||||
return dest;
|
dest[index] = '\0';
|
||||||
|
return dest + index;
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,8 +26,9 @@
|
||||||
|
|
||||||
extern "C" wchar_t* wcpcpy(wchar_t* restrict dest, const wchar_t* restrict src)
|
extern "C" wchar_t* wcpcpy(wchar_t* restrict dest, const wchar_t* restrict src)
|
||||||
{
|
{
|
||||||
while ( *src )
|
size_t index;
|
||||||
*dest++ = *src++;
|
for ( index = 0; src[index]; index++ )
|
||||||
*dest = L'\0';
|
dest[index] = src[index];
|
||||||
return dest;
|
dest[index] = L'\0';
|
||||||
|
return dest + index;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue