summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2006-04-25 21:23:39 +0300
committerSteve Peters <steve@fisharerojo.org>2006-04-28 02:12:03 +0000
commite80fed9da44c731a6f85b5544b737325bd9a41a7 (patch)
treeed45b5a4741d1cebf6930d3baf33fb3c0d808797 /op.c
parent658aef798ab992aed2b708fed0d12323ab3b1fcb (diff)
downloadperl-e80fed9da44c731a6f85b5544b737325bd9a41a7.tar.gz
Re: [PATCH] use snprintf/strlcpy/strlcat when useful
Message-ID: <444E3EFB.8020503@gmail.com> p4raw-id: //depot/perl@27987
Diffstat (limited to 'op.c')
-rw-r--r--op.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/op.c b/op.c
index 3c44f96148..0b92b65636 100644
--- a/op.c
+++ b/op.c
@@ -250,9 +250,13 @@ Perl_allocmy(pTHX_ char *name)
p = strchr(name, '\0');
/* The next block assumes the buffer is at least 205 chars
long. At present, it's always at least 256 chars. */
- if (p-name > 200) {
- strcpy(name+200, "...");
- p = name+199;
+ if (p - name > 200) {
+#ifdef HAS_STRLCPY
+ strlcpy(name + 200, "...", 4);
+#else
+ strcpy(name + 200, "...");
+#endif
+ p = name + 199;
}
else {
p[1] = '\0';