diff options
author | Chip Salzenberg <chip@perl.com> | 1997-04-30 17:27:58 +1200 |
---|---|---|
committer | Chip Salzenberg <chip@atlantic.net> | 1997-05-01 00:00:00 +1200 |
commit | bedebaa5d034917d531c5bc8c9415a048a98bf02 (patch) | |
tree | 9a8c03eee40237326349ef71dda30ec4771f555e /util.c | |
parent | 878e08dfd37ef18d0471607a99b747ae9fd31e93 (diff) | |
download | perl-bedebaa5d034917d531c5bc8c9415a048a98bf02.tar.gz |
Fix NUL-termination bug in delimcpy()
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -302,14 +302,13 @@ I32 *retlen; from++; } } - else if (*from == delim) { - if (to < toend) - *to = '\0'; + else if (*from == delim) break; - } if (to < toend) *to++ = *from; } + if (to < toend) + *to = '\0'; *retlen = tolen; return from; } |