mirror of
https://github.com/reactos/reactos.git
synced 2024-08-07 19:58:21 +00:00
Don't write more nul bytes than necessary
svn path=/trunk/; revision=7891
This commit is contained in:
parent
01723ab7ca
commit
c778f1be56
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: tcsncpy.h,v 1.1 2003/07/06 23:04:19 hyperion Exp $
|
/* $Id: tcsncpy.h,v 1.2 2004/01/27 21:43:47 gvg Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "tchar.h"
|
#include "tchar.h"
|
||||||
|
@ -22,7 +22,6 @@ _tcsncpy:
|
||||||
_tstos
|
_tstos
|
||||||
test %_treg(a), %_treg(a)
|
test %_treg(a), %_treg(a)
|
||||||
jnz .L1
|
jnz .L1
|
||||||
rep _tstos
|
|
||||||
|
|
||||||
.L2:
|
.L2:
|
||||||
mov 0x0C(%esp), %eax
|
mov 0x0C(%esp), %eax
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: tcsncpy.h,v 1.1 2003/07/06 23:04:19 hyperion Exp $
|
/* $Id: tcsncpy.h,v 1.2 2004/01/27 21:43:47 gvg Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
@ -15,7 +15,6 @@ _TCHAR * _tcsncpy(_TCHAR * dst, const _TCHAR * src, size_t n)
|
||||||
{
|
{
|
||||||
if((*d ++ = *s ++) == 0)
|
if((*d ++ = *s ++) == 0)
|
||||||
{
|
{
|
||||||
while (-- n != 0) *d ++ = 0;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue