fix sizeof bug
This code path is most likely not utilized anymore but upstream yocto is
calling out a compile error on this:
| control_host_obj.c: In function 'on_boot':
| control_host_obj.c:131:8: error: 'write' reading 4 bytes from a region of size 2 [-Werror=stringop-overflow=]
| 131 | rc = write(fd, one, sizeof(one));
| | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: Iabb5bcc0b888a4e831c8fe8c1006e9b99097402a
diff --git a/op-hostctl/control_host_obj.c b/op-hostctl/control_host_obj.c
index 2988d4f..0edc4b3 100644
--- a/op-hostctl/control_host_obj.c
+++ b/op-hostctl/control_host_obj.c
@@ -93,7 +93,7 @@
FSI_SCAN_PATH, strerror(errno));
return errno;
}
- rc = write(fd, one, sizeof(one));
+ rc = write(fd, one, sizeof(*one));
close(fd);
if (rc < 0) {
g_print("ERROR HostControl: Failed to perform FSI scan: %s\n",
@@ -128,7 +128,7 @@
FSI_EXTERNAL_MODE_PATH);
return TRUE;
}
- rc = write(fd, one, sizeof(one));
+ rc = write(fd, one, sizeof(*one));
if (rc < 0) {
g_print("ERROR HostControl: Failed to enable debug mode '%s'\n",
FSI_EXTERNAL_MODE_PATH);