Commit 6c2a07b6 authored by Vitezslav Kriz's avatar Vitezslav Kriz
Browse files

confdb: fix problem with big-endian on PowerPC

parent 20696e4b
......@@ -417,8 +417,9 @@ void conf_db_val(
}
assert(val->blob != NULL);
memcpy(&val->len, val->blob, sizeof(uint16_t));
val->len = le16toh(val->len);
uint16_t len;
memcpy(&len, val->blob, sizeof(uint16_t));
val->len = le16toh(len);
val->data = val->blob + sizeof(uint16_t);
val->code = KNOT_EOK;
} else {
......@@ -452,8 +453,9 @@ void conf_db_val_next(
if (val->data + val->len < val->blob + val->blob_len) {
val->data += val->len;
memcpy(&val->len, val->data, sizeof(uint16_t));
val->len = le16toh(val->len);
uint16_t len;
memcpy(&len, val->data, sizeof(uint16_t));
val->len = le16toh(len);
val->data += sizeof(uint16_t);
val->code = KNOT_EOK;
} else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment