prop = calloc(1, sizeof(struct section_property));
if (!prop)
continue;
- strncpy(prop->key, tmp_key, sizeof(prop->key) - 1);
- strncpy(prop->value, tmp_value, sizeof(prop->value) - 1);
+ /* to suppress build warning of strncpy(-Wstringop-truncation),
+ * use memcpy instead. */
+ memcpy(prop->key, tmp_key, sizeof(prop->key) - 1);
+ memcpy(prop->value, tmp_value, sizeof(prop->value) - 1);
result.props = g_list_append(result.props, prop);
}
}
i = 0;
SYS_G_LIST_FOREACH(head, elem, elem2) {
- value = (int) elem2;
+ value = (int)(intptr_t) elem2;
assert_int_equal(value, i++);
}
}
i = 10;
SYS_G_LIST_FOREACH(head, elem, elem2) {
- value = (int) elem2;
+ value = (int)(intptr_t) elem2;
assert_int_equal(value, --i);
}
}