summaryrefslogtreecommitdiff
path: root/Mac/Python/macglue.c
diff options
context:
space:
mode:
Diffstat (limited to 'Mac/Python/macglue.c')
-rw-r--r--Mac/Python/macglue.c11
1 files changed, 11 insertions, 0 deletions
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)
{