diff options
author | Alice Frosi <afrosi@redhat.com> | 2023-02-21 14:32:42 +0100 |
---|---|---|
committer | Alice Frosi <afrosi@redhat.com> | 2023-02-21 14:33:16 +0100 |
commit | 4cad95ec182ab9f3d28f37cfab9fb28ccb596cd7 (patch) | |
tree | 86dd5dee9324935624ddc74f80ebf49a9a4ed82e /actions.c | |
parent | 54d77774c65b100fbbe3b28c55ccd93cd40c8f45 (diff) | |
download | seitan-4cad95ec182ab9f3d28f37cfab9fb28ccb596cd7.tar seitan-4cad95ec182ab9f3d28f37cfab9fb28ccb596cd7.tar.gz seitan-4cad95ec182ab9f3d28f37cfab9fb28ccb596cd7.tar.bz2 seitan-4cad95ec182ab9f3d28f37cfab9fb28ccb596cd7.tar.lz seitan-4cad95ec182ab9f3d28f37cfab9fb28ccb596cd7.tar.xz seitan-4cad95ec182ab9f3d28f37cfab9fb28ccb596cd7.tar.zst seitan-4cad95ec182ab9f3d28f37cfab9fb28ccb596cd7.zip |
actions: change pointer to offset
Diffstat (limited to 'actions.c')
-rw-r--r-- | actions.c | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -211,14 +211,12 @@ int do_actions(void *data, struct action actions[], unsigned int n_actions, int resp.id = id; resp.flags = 0; resp.error = 0; - if (actions[i].ret.type == IMMEDIATE) { + if (actions[i].ret.type == IMMEDIATE) resp.val = actions[i].ret.value; - } else if (actions[i].ret.value_p != NULL) { - resp.val = *(actions[i].ret.value_p); - } else { - fprintf(stderr, "empty reference for the return value"); - return -1; - } + else + memcpy(&resp.val, (uint16_t *)data + + actions[i].ret.value_off, + sizeof(resp.val)); if (send_target(&resp, notifyfd) == -1) return -1; |