]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
Added explicit cast to unsigned long before pointer cast in ioctl mock function
authorsstrehla <slawomir.strehlau@intel.com>
Mon, 20 Jul 2020 10:52:48 +0000 (12:52 +0200)
committersstrehla <slawomir.strehlau@intel.com>
Mon, 20 Jul 2020 10:52:48 +0000 (12:52 +0200)
src/smart_test.c

index f458c851b1aeab9b54b61d93e48b6f3df4eb1dd4..f1a01e639a4480755072d164baed53dc8b30da9e 100644 (file)
@@ -41,7 +41,7 @@ int ioctl(int __fd, unsigned long int __request, ...) {
   va_start(valist, __request);
   struct nvme_admin_cmd *admin_cmd = va_arg(valist, struct nvme_admin_cmd *);
   va_end(valist);
-  void *addr = (void *)admin_cmd->addr;
+  void *addr = (void *)(unsigned long)admin_cmd->addr;
 
   if (admin_cmd->opcode == NVME_ADMIN_IDENTIFY) {
     // ioctl asked about vid