summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2023-05-08 14:18:37 -0400
committerTavian Barnes <tavianator@tavianator.com>2023-05-08 14:18:37 -0400
commit3f1822caed3dca731997c8739c19ee32e5caadc1 (patch)
tree49c84b1cd4119b7925ca4d4d82772fa834f4bf6e /src
parentc1b16b49988ecff17ae30978ea14798d95b80018 (diff)
downloadbfs-3f1822caed3dca731997c8739c19ee32e5caadc1.tar.xz
config: Hoist the assignment outside of BFS_UNINIT()
Diffstat (limited to 'src')
-rw-r--r--src/config.h4
-rw-r--r--src/parse.c8
2 files changed, 6 insertions, 6 deletions
diff --git a/src/config.h b/src/config.h
index 5f54250..ed3f6ab 100644
--- a/src/config.h
+++ b/src/config.h
@@ -204,9 +204,9 @@
* Initialize a variable, unless sanitizers would detect uninitialized uses.
*/
#if __has_feature(memory_sanitizer)
-# define BFS_UNINIT(var, value) var = var
+# define BFS_UNINIT(var, value) var
#else
-# define BFS_UNINIT(var, value) var = value
+# define BFS_UNINIT(var, value) value
#endif
#endif // BFS_CONFIG_H
diff --git a/src/parse.c b/src/parse.c
index 30bf56d..9540e83 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -1962,11 +1962,11 @@ static int parse_mode(const struct parser_state *state, const char *mode, struct
MODE_PLUS,
MODE_MINUS,
MODE_EQUALS,
- } BFS_UNINIT(op, MODE_EQUALS);
+ } op = BFS_UNINIT(op, MODE_EQUALS);
- mode_t BFS_UNINIT(who, 0);
- mode_t BFS_UNINIT(file_change, 0);
- mode_t BFS_UNINIT(dir_change, 0);
+ mode_t who = BFS_UNINIT(who, 0);
+ mode_t file_change = BFS_UNINIT(file_change, 0);
+ mode_t dir_change = BFS_UNINIT(dir_change, 0);
const char *i = mode;
while (true) {