diff options
| author | Onur Gündüz <ogunduz@gmail.com> | 2026-06-27 00:58:05 +0200 |
|---|---|---|
| committer | Onur Gündüz <ogunduz@gmail.com> | 2026-06-27 01:03:41 +0200 |
| commit | af55803d0dff9eb692c760c8d486e736c945061d (patch) | |
| tree | 0875a1112bf98304e445e0544c4309670d6f4769 /libffwd/config.c | |
| parent | 0f861b7f3098750ddee4f6570f3be228d1da5320 (diff) | |
| download | ffwd-af55803d0dff9eb692c760c8d486e736c945061d.tar.gz ffwd-af55803d0dff9eb692c760c8d486e736c945061d.zip | |
chore: clean up comment formatting and wording
Diffstat (limited to 'libffwd/config.c')
| -rw-r--r-- | libffwd/config.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/libffwd/config.c b/libffwd/config.c index 6531658..d9efb4d 100644 --- a/libffwd/config.c +++ b/libffwd/config.c @@ -9,7 +9,7 @@ #include <stdlib.h> #include <string.h> -/* Verbosity flag, read across the codebase for optional stderr diagnostics. +/* Verbosity flag for optional stderr diagnostics across the codebase. * Defined in config.c because every backend links it. */ int ffwd_verbose = 0; @@ -20,11 +20,13 @@ typedef enum { JSON_BOOL_INVALID = -1, } json_bool_t; -/* Field readers over a parsed JSON object. yyjson getters are NULL-tolerant, so - * a missing key or wrong-typed value falls back cleanly. These replace a - * substring scanner that could match a key nested anywhere in the document - * (e.g. a field inside a nested sub-config), which is exactly the failure mode - * a real parser removes. */ +/* Read fields from a parsed JSON object. + * yyjson getters tolerate NULL, so missing keys or wrong types cleanly return + * the fallback. + * + * This replaces substring scanning, which could match a key anywhere in the + * document, including inside nested sub-configs. A real parser avoids that + * failure mode. */ static int json_get_int(yyjson_val *obj, const char *key, int fallback) { yyjson_val *v = yyjson_obj_get(obj, key); if (yyjson_is_int(v)) |
