1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-28 01:35:32 +00:00

Initialize the string->length in init_dom_string()

This commit is contained in:
Jonas Fonseca 2005-12-28 19:49:22 +01:00 committed by Jonas Fonseca
parent 1b71368459
commit e34d0d3de4

View File

@ -42,7 +42,11 @@ static inline struct dom_string *
init_dom_string(struct dom_string *string, unsigned char *str, size_t len)
{
string->string = memacpy(str, len);
return string->string ? string : NULL;
if (!string->string)
return NULL;
string->length = len;
return string;
}
#define is_dom_string_set(str) ((str)->string && (str)->length)