diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2006-04-25 21:23:39 +0300 |
---|---|---|
committer | Steve Peters <steve@fisharerojo.org> | 2006-04-28 02:12:03 +0000 |
commit | e80fed9da44c731a6f85b5544b737325bd9a41a7 (patch) | |
tree | ed45b5a4741d1cebf6930d3baf33fb3c0d808797 /op.c | |
parent | 658aef798ab992aed2b708fed0d12323ab3b1fcb (diff) | |
download | perl-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.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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'; |