From 27fd6f9615f36aec71877e2b99aa3655e22da75d Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Tue, 13 Jun 2023 05:08:30 +0200 Subject: minor refactoring --- src/storage_sqlite.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/storage_sqlite.c') diff --git a/src/storage_sqlite.c b/src/storage_sqlite.c index 0bd2e88..507f5b1 100644 --- a/src/storage_sqlite.c +++ b/src/storage_sqlite.c @@ -57,12 +57,12 @@ struct storage_sqlite { static int storage_upgrade_sqlite_to(struct storage_sqlite *storage, size_t version) { - static const char *const FMT = "%s PRAGMA user_version = %zu;"; + static const char *const fmt = "%s PRAGMA user_version = %zu;"; const char *script = sql_sqlite_files[version]; int ret = 0; - ret = snprintf(NULL, 0, FMT, script, version + 1); + ret = snprintf(NULL, 0, fmt, script, version + 1); size_t nb = (size_t)ret + 1; ret = 0; @@ -71,7 +71,7 @@ static int storage_upgrade_sqlite_to(struct storage_sqlite *storage, size_t vers log_errno("malloc"); return -1; } - snprintf(full_script, nb, FMT, script, version + 1); + snprintf(full_script, nb, fmt, script, version + 1); ret = sqlite_exec_as_transaction(storage->db, full_script); goto free; -- cgit v1.3