CoreFW  Diff

Differences From Artifact [3b8850abd4]:

To Artifact [305d89e8e8]:


176
177
178
179
180
181
182

183

184
185






186
187
188
189
190
191
192
193
194










195
196
197
198
199
200
201
	return string->len;
}

bool
cfw_string_set(CFWString *str, const char *cstr)
{
	char *copy;



	if ((copy = cfw_strdup(cstr)) == NULL)
		return false;







	if (str->data != NULL)
		free(str->data);

	str->data = copy;
	str->len = strlen(copy);

	return true;
}











bool
cfw_string_append(CFWString *str, CFWString *append)
{
	char *new;

	if ((new = realloc(str->data, str->len + append->len + 1)) == NULL)







>

>
|
|
>
>
>
>
>
>





|



>
>
>
>
>
>
>
>
>
>







176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
	return string->len;
}

bool
cfw_string_set(CFWString *str, const char *cstr)
{
	char *copy;
	size_t len;

	if (str != NULL) {
		if ((copy = cfw_strdup(cstr)) == NULL)
			return false;

		len = strlen(copy);
	} else {
		copy = NULL;
		len = 0;
	}

	if (str->data != NULL)
		free(str->data);

	str->data = copy;
	str->len = len;

	return true;
}

void
cfw_string_set_nocopy(CFWString *str, char *cstr, size_t len)
{
	if (str->data != NULL)
		free(str->data);

	str->data = cstr;
	str->len = len;
}

bool
cfw_string_append(CFWString *str, CFWString *append)
{
	char *new;

	if ((new = realloc(str->data, str->len + append->len + 1)) == NULL)