mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-27 14:29:42 +03:00
copy the options data with memcpy instead
This commit is contained in:
parent
9d00f63ff4
commit
45d309c0e3
@ -395,19 +395,15 @@ nsoption_init(nsoption_set_default_t *set_defaults,
|
||||
src = &defaults[0];
|
||||
dst = opts;
|
||||
|
||||
memcpy(dst, src, sizeof(defaults));
|
||||
|
||||
while (src->key != NULL) {
|
||||
dst->key = src->key;
|
||||
dst->key_len = src->key_len;
|
||||
dst->type = src->type;
|
||||
if ((src->type == OPTION_STRING) && (src->value.s != NULL)) {
|
||||
dst->value.s = strdup(src->value.s);
|
||||
} else {
|
||||
dst->value = src->value;
|
||||
}
|
||||
src++;
|
||||
dst++;
|
||||
}
|
||||
dst->key = src->key;
|
||||
|
||||
/* return values if wanted */
|
||||
if (popts != NULL) {
|
||||
|
Loading…
Reference in New Issue
Block a user