aboutgitcodelistschat:MatrixIRC
path: root/actions.c
diff options
context:
space:
mode:
authorAlice Frosi <afrosi@redhat.com>2023-02-21 14:32:42 +0100
committerAlice Frosi <afrosi@redhat.com>2023-02-21 14:33:16 +0100
commit4cad95ec182ab9f3d28f37cfab9fb28ccb596cd7 (patch)
tree86dd5dee9324935624ddc74f80ebf49a9a4ed82e /actions.c
parent54d77774c65b100fbbe3b28c55ccd93cd40c8f45 (diff)
downloadseitan-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.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/actions.c b/actions.c
index 6a7f55c..bb603af 100644
--- a/actions.c
+++ b/actions.c
@@ -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;