diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2000-12-12 22:12:14 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2000-12-12 22:12:14 (GMT) |
commit | 5afad8315b259b90e827f6a78e63b2a23e21bfb0 (patch) | |
tree | 07c728348378b7237698e8fba2702410f37ec8e0 /Mac | |
parent | 3661d3947429bc809eaf851467bf5b0a1192012b (diff) | |
download | cpython-5afad8315b259b90e827f6a78e63b2a23e21bfb0.zip cpython-5afad8315b259b90e827f6a78e63b2a23e21bfb0.tar.gz cpython-5afad8315b259b90e827f6a78e63b2a23e21bfb0.tar.bz2 |
Added a c2pstrcpy() function.
Diffstat (limited to 'Mac')
-rw-r--r-- | Mac/Python/macglue.c | 11 |
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) { |