Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c4eb765

Browse files
author
Victor Stinner
committed
Create Py_UNICODE_strcat() function
1 parent f37ca3c commit c4eb765

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

Include/unicodeobject.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1573,6 +1573,9 @@ PyAPI_FUNC(Py_UNICODE*) Py_UNICODE_strcpy(
15731573
Py_UNICODE *s1,
15741574
const Py_UNICODE *s2);
15751575

1576+
PyAPI_FUNC(Py_UNICODE*) Py_UNICODE_strcat(
1577+
Py_UNICODE *s1, const Py_UNICODE *s2);
1578+
15761579
PyAPI_FUNC(Py_UNICODE*) Py_UNICODE_strncpy(
15771580
Py_UNICODE *s1,
15781581
const Py_UNICODE *s2,

Objects/unicodeobject.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9951,6 +9951,15 @@ Py_UNICODE_strncpy(Py_UNICODE *s1, const Py_UNICODE *s2, size_t n)
99519951
return s1;
99529952
}
99539953

9954+
Py_UNICODE*
9955+
Py_UNICODE_strcat(Py_UNICODE *s1, const Py_UNICODE *s2)
9956+
{
9957+
Py_UNICODE *u1 = s1;
9958+
u1 += Py_UNICODE_strlen(u1);
9959+
Py_UNICODE_strcpy(u1, s2);
9960+
return s1;
9961+
}
9962+
99549963
int
99559964
Py_UNICODE_strcmp(const Py_UNICODE *s1, const Py_UNICODE *s2)
99569965
{

0 commit comments

Comments
 (0)