Differences From Artifact [415ab5e653]:
- File src/string.c — part of check-in [a2613e09be] at 2012-04-09 14:06:27 on branch trunk — Add hashing. (user: js, size: 4100) [annotate] [blame] [check-ins using]
To Artifact [5092f0f99a]:
- File
src/string.c
— part of check-in
[bdb850f3e2]
at
2012-04-22 02:34:50
on branch trunk
— ctor: Set pointers to NULL before allocation.
This way, the dtor can work correctly. (user: js, size: 4120) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
41 42 43 44 45 46 47 48 49 50 51 52 53 54 | static bool ctor(void *ptr, va_list args) { CFWString *str = ptr; const char *cstr = va_arg(args, const char*); if (cstr != NULL) { if ((str->data = strdup(cstr)) == NULL) return false; str->len = strlen(cstr); } else { str->data = NULL; str->len = 0; | > | 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | static bool ctor(void *ptr, va_list args) { CFWString *str = ptr; const char *cstr = va_arg(args, const char*); if (cstr != NULL) { str->data = NULL; if ((str->data = strdup(cstr)) == NULL) return false; str->len = strlen(cstr); } else { str->data = NULL; str->len = 0; |
︙ | ︙ |