summaryrefslogtreecommitdiffstats
path: root/Mac
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2000-12-12 22:12:14 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2000-12-12 22:12:14 (GMT)
commit5afad8315b259b90e827f6a78e63b2a23e21bfb0 (patch)
tree07c728348378b7237698e8fba2702410f37ec8e0 /Mac
parent3661d3947429bc809eaf851467bf5b0a1192012b (diff)
downloadcpython-5afad8315b259b90e827f6a78e63b2a23e21bfb0.zip
cpython-5afad8315b259b90e827f6a78e63b2a23e21bfb0.tar.gz
cpython-5afad8315b259b90e827f6a78e63b2a23e21bfb0.tar.bz2
Added a c2pstrcpy() function.
Diffstat (limited to 'Mac')
-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 67c3918..ded0ad1 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)
{