Initial revision
This commit is contained in:
12
stralloc/stralloc_readyplus.c
Normal file
12
stralloc/stralloc_readyplus.c
Normal file
@@ -0,0 +1,12 @@
|
||||
#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 int len) {
|
||||
if (sa->s)
|
||||
return stralloc_ready(sa,sa->len+len);
|
||||
else
|
||||
return stralloc_ready(sa,len);
|
||||
}
|
||||
Reference in New Issue
Block a user