This commit is contained in:
hyung-hwan 2008-02-02 01:12:07 +00:00
parent 9e64175662
commit da81db7a34
2 changed files with 24 additions and 0 deletions

View File

@ -86,6 +86,28 @@ ase_size_t ase_strxncpy (
return n; return n;
} }
ase_size_t ase_strxcat (ase_char_t* buf, ase_size_t bsz, const ase_char_t* str)
{
ase_char_t* p, * p2;
ase_size_t blen;
blen = ase_strlen(buf);
if (blen >= bsz) return blen; /* something wrong */
p = buf + blen;
p2 = buf + bsz - 1;
while (p < p2)
{
if (*str == ASE_T('\0')) break;
*p++ = *str++;
}
if (bsz > 0) *p = ASE_T('\0');
return p - buf;
}
ase_size_t ase_strxncat ( ase_size_t ase_strxncat (
ase_char_t* buf, ase_size_t bsz, const ase_char_t* str, ase_size_t len) ase_char_t* buf, ase_size_t bsz, const ase_char_t* str, ase_size_t len)
{ {

View File

@ -42,6 +42,8 @@ ase_size_t ase_strncpy (
ase_size_t ase_strxncpy ( ase_size_t ase_strxncpy (
ase_char_t* buf, ase_size_t bsz, const ase_char_t* str, ase_size_t len); ase_char_t* buf, ase_size_t bsz, const ase_char_t* str, ase_size_t len);
ase_size_t ase_strxcat (
ase_char_t* buf, ase_size_t bsz, const ase_char_t* str);
ase_size_t ase_strxncat ( ase_size_t ase_strxncat (
ase_char_t* buf, ase_size_t bsz, const ase_char_t* str, ase_size_t len); ase_char_t* buf, ase_size_t bsz, const ase_char_t* str, ase_size_t len);