diff --git a/inc/lektor/lib/strv.h b/inc/lektor/lib/strv.h index 981bf02f1d10141fba3f1225680e72f10112fb00..151c64fc1683e548bc2a7a33a5c26d04ebfde6cc 100644 --- a/inc/lektor/lib/strv.h +++ b/inc/lektor/lib/strv.h @@ -266,7 +266,8 @@ strv_equal(struct strv a, struct strv b) static _Bool strv_equal_nocase(struct strv a, struct strv b) { - if (a.count != b.count) return (_Bool)0; + if (a.count != b.count) + return (_Bool)0; for (int i = 0; i < a.count; ++i) { if (strv_ctoupper(a.data[i]) != strv_ctoupper(b.data[i])) return (_Bool)0; @@ -301,7 +302,7 @@ strv_len(struct strv sv) static struct strv strv_copy(const struct strv sv) { - return (struct strv) { .data = sv.data, .count = sv.count }; + return (struct strv){ .data = sv.data, .count = sv.count }; } static int @@ -310,8 +311,8 @@ strv_to_int(const struct strv sv_init) if (strv_len(sv_init) == 0) return 0; - int total = 0; - struct strv sv = strv_copy(sv_init); + int total = 0; + struct strv sv = strv_copy(sv_init); const _Bool negative = strv_chop_left(&sv, 1).data[0] == '-'; for (int i = 0; i < sv.count; ++i) diff --git a/src/base/config.c b/src/base/config.c index 7db7087865c948a48b0e2774e7d29ccad5d86ead..08deb3046104f29806afb52bbd7d1c77b39562c7 100644 --- a/src/base/config.c +++ b/src/base/config.c @@ -155,17 +155,20 @@ ini_parse(const char *path, lkt_db *db) const struct strv key = strv_trim(strv_chop_left(&line, separator_index)); strv_chop_left(&line, 1); /* Skip the "=" character */ - const struct strv value = strv_trim(strv_take_left_while(line, ___char_is_not_comment_delim)); + const struct strv value = + strv_trim(strv_take_left_while(line, ___char_is_not_comment_delim)); /* Handle the (key, value) pair */ if (strv_len(value) == 0 || strv_len(key) == 0) { LOG_ERROR("PARSER", "Invalid key pair at line '%d'", linenum); - LOG_ERROR_IF(strv_len(key), "PARSER", "The key was: '"STRV_FMT"'", STRV_ARG(key)); - LOG_ERROR_IF(strv_len(value), "PARSER", "The value was: '"STRV_FMT"'", STRV_ARG(value)); + LOG_ERROR_IF(strv_len(key), "PARSER", "The key was: '" STRV_FMT "'", STRV_ARG(key)); + LOG_ERROR_IF(strv_len(value), "PARSER", "The value was: '" STRV_FMT "'", + STRV_ARG(value)); } else if (section[0]) { - LOG_DEBUG("PARSER", "Found line: [%s] '"STRV_FMT"' = '"STRV_FMT"'", section, STRV_ARG(key), STRV_ARG(value)); + LOG_DEBUG("PARSER", "Found line: [%s] '" STRV_FMT "' = '" STRV_FMT "'", section, + STRV_ARG(key), STRV_ARG(value)); if (handler(db, section, key, value)) { error = 1; LOG_ERROR("PARSER", diff --git a/src/database/config.c b/src/database/config.c index a7864179d5d1b16928fe85ef72af7705b80f83a0..8ea85fa5d5f7acf863563bd5b0a8bcc1f3b6a3ff 100644 --- a/src/database/config.c +++ b/src/database/config.c @@ -26,7 +26,7 @@ database_config_set_strv_1_2(lkt_db *db, const char *section, const struct strv goto error; } - LOG_DEBUG("CONFIG", "Set [%s/"STRV_FMT"] to "STRV_FMT, section, STRV_ARG(key), + LOG_DEBUG("CONFIG", "Set [%s/" STRV_FMT "] to " STRV_FMT, section, STRV_ARG(key), STRV_ARG(value)); ret = true; error: