From 96658d75dfb8a5106366e211ed5fa70d77a0c740 Mon Sep 17 00:00:00 2001 From: Michael McVady Date: Mon, 2 Jan 2023 20:24:50 -0600 Subject: Formatting --- src/init.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) (limited to 'src/init.c') diff --git a/src/init.c b/src/init.c index 1664ed6..3208796 100644 --- a/src/init.c +++ b/src/init.c @@ -7,8 +7,7 @@ void kore_parent_configure(int, char **); static const char *database = "db"; void -kore_parent_configure(int argc, char **argv) -{ +kore_parent_configure(int argc, char **argv) { int err = 0; kore_default_getopt(argc, argv); @@ -21,8 +20,7 @@ kore_parent_configure(int argc, char **argv) } int -init_db(void) -{ +init_db(void) { int err = 0; const char *pg_config = NULL; @@ -41,49 +39,31 @@ init_db(void) // Parse env vars and build PostgreSQL config string env = getenv("POSTGRES_HOST"); if (env) - { kore_buf_appendf(pg_config_buf, "host=%s ", env); - } else - { kore_buf_append(pg_config_buf, host, strlen(host)); - } env = getenv("POSTGRES_PORT"); if (env) - { kore_buf_appendf(pg_config_buf, "port=%s ", env); - } else - { kore_buf_append(pg_config_buf, port, strlen(port)); - } env = getenv("POSTGRES_USER"); if (env) - { kore_buf_appendf(pg_config_buf, "user=%s ", env); - } else - { kore_buf_append(pg_config_buf, user, strlen(user)); - } env = getenv("POSTGRES_PASSWORD"); if (env) - { kore_buf_appendf(pg_config_buf, "password=%s ", env); - } env = getenv("POSTGRES_DBNAME"); if (env) - { kore_buf_appendf(pg_config_buf, "user=%s ", env); - } else - { kore_buf_append(pg_config_buf, dbname, strlen(dbname)); - } kore_buf_append(pg_config_buf, sslmode, strlen(sslmode)); -- cgit v1.2.3