Skip to content

Commit

Permalink
Note that string_grow still has the problem with not bothering to all…
Browse files Browse the repository at this point in the history
…ocate a

new buffer if copysize is zero, e.g. if we are expanding a previously empty
buffer.

Courtesy of "Peter Gibbs" <peter@emkel.co.za>


git-svn-id: https://svn.parrot.org/parrot/trunk@1340 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information
dsugalski committed Apr 15, 2002
1 parent b2336dd commit b239e81
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
5 changes: 0 additions & 5 deletions src/string.c
Expand Up @@ -72,11 +72,6 @@ string_make(struct Parrot_Interp *interpreter, const void *buffer,
*/
STRING *
string_grow(struct Parrot_Interp * interpreter, STRING * s, INTVAL addlen) {
INTVAL copysize = s->bufused;
if(addlen < 0)
copysize += addlen;
if(copysize <= 0)
return s;
/* Don't check buflen, if we are here, we already checked. */
Parrot_reallocate(interpreter, s, s->buflen + addlen);
return s;
Expand Down
5 changes: 0 additions & 5 deletions string.c
Expand Up @@ -72,11 +72,6 @@ string_make(struct Parrot_Interp *interpreter, const void *buffer,
*/
STRING *
string_grow(struct Parrot_Interp * interpreter, STRING * s, INTVAL addlen) {
INTVAL copysize = s->bufused;
if(addlen < 0)
copysize += addlen;
if(copysize <= 0)
return s;
/* Don't check buflen, if we are here, we already checked. */
Parrot_reallocate(interpreter, s, s->buflen + addlen);
return s;
Expand Down

0 comments on commit b239e81

Please sign in to comment.