strbuffer: Optimize string termination

Do not zero all of the memory, just the first unused byte to make the
string null terminated.
This commit is contained in:
Petri Lehtinen
2009-06-30 14:39:55 +03:00
parent b724c2b122
commit 55af26f05a
2 changed files with 5 additions and 6 deletions

View File

@@ -3,8 +3,8 @@
typedef struct {
char *value;
int length;
int size;
int length; /* bytes used */
int size; /* bytes allocated */
} strbuffer_t;
int strbuffer_init(strbuffer_t *strbuff);