From 5afad8315b259b90e827f6a78e63b2a23e21bfb0 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Tue, 12 Dec 2000 22:12:14 +0000 Subject: [PATCH] Added a c2pstrcpy() function. --- Mac/Python/macglue.c | 11 +++++++++++ 1 file changed, 11 insertions(+) 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) { -- 2.50.0