You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
424 B
C

24 years ago
#include "stralloc.h"
#include <stdlib.h>
/* stralloc_readyplus is like stralloc_ready except that, if sa is
* already allocated, stralloc_readyplus adds the current length of sa
* to len. */
int stralloc_readyplus(stralloc *sa,unsigned long len) {
if (sa->s) {
if (sa->len + len < len) return 0; /* catch integer overflow */
24 years ago
return stralloc_ready(sa,sa->len+len);
} else
24 years ago
return stralloc_ready(sa,len);
}