mirror of https://github.com/python/cpython.git
Added a c2pstrcpy() function.
This commit is contained in:
parent
3661d39474
commit
5afad8315b
|
@ -345,6 +345,17 @@ Pstring(char *str)
|
|||
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 */
|
||||
char *PyMac_StrError(int err)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue