chiark
/
gitweb
/
~mdw
/
mLib
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
(ident_socket): change sizes to be @size_t@.
[mLib]
/
dstr.c
diff --git
a/dstr.c
b/dstr.c
index d76ccf51187b6d282d28250433f2d96e5151c41e..273c53acebe51229361e11d22d23f872986392d3 100644
(file)
--- a/
dstr.c
+++ b/
dstr.c
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-c-*-
*
- * $Id: dstr.c,v 1.1
4 2000/06/17 10:37:39
mdw Exp $
+ * $Id: dstr.c,v 1.1
5 2000/07/16 12:29:16
mdw Exp $
*
* Handle dynamically growing strings
*
*
* Handle dynamically growing strings
*
@@
-30,6
+30,9
@@
/*----- Revision history --------------------------------------------------*
*
* $Log: dstr.c,v $
/*----- Revision history --------------------------------------------------*
*
* $Log: dstr.c,v $
+ * Revision 1.15 2000/07/16 12:29:16 mdw
+ * Change to arena `realloc' interface, to fix a design bug.
+ *
* Revision 1.14 2000/06/17 10:37:39 mdw
* Add support for arena management.
*
* Revision 1.14 2000/06/17 10:37:39 mdw
* Add support for arena management.
*
@@
-159,7
+162,7
@@
void dstr_ensure(dstr *d, size_t sz)
do nsz <<= 1; while (nsz < rq);
if (d->buf)
do nsz <<= 1; while (nsz < rq);
if (d->buf)
- d->buf = x_realloc(d->a, d->buf, nsz);
+ d->buf = x_realloc(d->a, d->buf, nsz
, d->sz
);
else
d->buf = x_alloc(d->a, nsz);
d->sz = nsz;
else
d->buf = x_alloc(d->a, nsz);
d->sz = nsz;
@@
-240,7
+243,7
@@
void dstr_putm(dstr *d, const void *p, size_t sz) { DPUTM(d, p, sz); }
void dstr_tidy(dstr *d)
{
void dstr_tidy(dstr *d)
{
- d->buf = x_realloc(d->a, d->buf, d->len + 1);
+ d->buf = x_realloc(d->a, d->buf, d->len + 1
, d->sz
);
d->buf[d->len] = 0;
d->sz = d->len + 1;
}
d->buf[d->len] = 0;
d->sz = d->len + 1;
}