From ba6e5e06029b7a3b3cc6517d5f0cabda871a6652 Mon Sep 17 00:00:00 2001 From: David Teigland Date: Apr 16 2024 17:38:49 +0000 Subject: sanlock: remove zero length arrays --- diff --git a/src/sanlock.h b/src/sanlock.h index 978aac7..5894020 100644 --- a/src/sanlock.h +++ b/src/sanlock.h @@ -105,7 +105,7 @@ struct sanlk_resource { uint32_t flags; /* SANLK_RES_ */ uint32_t num_disks; /* followed by num_disks sanlk_disk structs */ - struct sanlk_disk disks[0]; + struct sanlk_disk disks[]; }; /* make these values match the RES equivalent in case of typos */ @@ -139,7 +139,7 @@ struct sanlk_options { uint32_t flags; uint32_t len; /* unused and ignored */ /* followed by len bytes (unused and ignored) */ - char str[0]; + char str[]; }; #define SANLK_LSF_ADD 0x00000001 diff --git a/src/sanlock_sock.h b/src/sanlock_sock.h index 0121b9c..924468d 100644 --- a/src/sanlock_sock.h +++ b/src/sanlock_sock.h @@ -91,7 +91,7 @@ struct sanlk_state { uint64_t data64; char name[SANLK_NAME_LEN]; /* client name or resource name */ uint32_t str_len; - char str[0]; /* string of internal state */ + char str[]; /* string of internal state */ }; int sanlock_socket_address(const char *dir, struct sockaddr_un *addr);