mirror of
https://github.com/python/cpython.git
synced 2025-11-17 01:25:57 +00:00
Added a c2pstrcpy() function.
This commit is contained in:
parent
3661d39474
commit
5afad8315b
1 changed files with 11 additions and 0 deletions
|
|
@ -345,6 +345,17 @@ Pstring(char *str)
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
c2pstrcpy(unsigned char *dst, const char *src)
|
||||||
|
{
|
||||||
|
int len;
|
||||||
|
|
||||||
|
len = strlen(src);
|
||||||
|
if ( len > 255 ) len = 255;
|
||||||
|
strncpy((char *)dst+1, src, len);
|
||||||
|
dst[0] = len;
|
||||||
|
}
|
||||||
|
|
||||||
/* Like strerror() but for Mac OS error numbers */
|
/* Like strerror() but for Mac OS error numbers */
|
||||||
char *PyMac_StrError(int err)
|
char *PyMac_StrError(int err)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue