From 32cbb152660566042ac25b00de4b19b1c90c0f5c Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch
Date: Mon, 16 Dec 2024 09:09:03 +0100 Subject: Serialize integer-ish config keys properly --- liberty.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'liberty.c') diff --git a/liberty.c b/liberty.c index ff7c0c7..0690e89 100644 --- a/liberty.c +++ b/liberty.c @@ -4833,7 +4833,8 @@ config_item_write_kv_pair (struct config_writer *self, str_append_printf (self->output, "%s# %s\n", indent, value->schema->comment); - bool can_use_word = true; + char *end = NULL; + bool can_use_word = ((void) strtoll (key, &end, 10), end == key); for (const char *p = key; *p; p++) if (!config_tokenizer_is_word_char (*p)) can_use_word = false; -- cgit v1.2.3-70-g09d2