From: Jack Jansen Date: Tue, 12 Dec 2000 22:12:14 +0000 (+0000) Subject: Added a c2pstrcpy() function. X-Git-Tag: v2.1a1~616 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5afad8315b259b90e827f6a78e63b2a23e21bfb0;p=python Added a c2pstrcpy() function. --- diff --git a/Mac/Python/macglue.c b/Mac/Python/macglue.c index 67c3918686..ded0ad1e19 100644 --- a/Mac/Python/macglue.c +++ b/Mac/Python/macglue.c @@ -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) {