From 2638802ccd0d0776ebf1867181d4e3950a147074 Mon Sep 17 00:00:00 2001 From: gramanas Date: Sat, 10 Nov 2018 22:47:03 +0200 Subject: Home dir --- src/dblayer.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) (limited to 'src/dblayer.c') diff --git a/src/dblayer.c b/src/dblayer.c index 244db62..08b1e4c 100644 --- a/src/dblayer.c +++ b/src/dblayer.c @@ -420,9 +420,7 @@ int edit_get_prime_config_from_program(DB *db, char *pName, char *ret, int *secr if (program_has_primary_config(db, pid, path, secret) == 1) { if (!str_is_empty(path)) { if (ret) { - char confName[STR_M]; - str_make_ck_config_name(confName, path, pName); - strcpy(ret, confName); + str_make_ck_config_name(ret, path, pName); } return 0; } @@ -532,14 +530,14 @@ int get_program_paths(DB *db, cklist *ckl, const char* pName, int bname, int att strcat(entry, tmp); } if (attr) { - /* secret */ - if (sqlite3_column_int(stmt, 1)) { - strcat(entry, " [s]"); - } /* primary */ if (sqlite3_column_int(stmt, 2)) { strcat(entry, " [p]"); } + /* secret */ + if (sqlite3_column_int(stmt, 1)) { + strcat(entry, " [s]"); + } /* root */ if (util_is_link_owned_by_root((char *)sqlite3_column_text(stmt, 0))) { strcat(entry, " [root]"); @@ -577,14 +575,14 @@ int list_get_paths(DB *db, cklist *ckl, int bName, int attr) { } free(tmp); if (attr) { - /* secret */ - if (sqlite3_column_int(stmt, 1)) { - strcat(path, " [s]"); - } /* primary */ if (sqlite3_column_int(stmt, 2)) { strcat(path, " [p]"); } + /* secret */ + if (sqlite3_column_int(stmt, 1)) { + strcat(path, " [s]"); + } /* root */ if (util_is_link_owned_by_root((char *)sqlite3_column_text(stmt, 0))) { strcat(path, " [root]"); @@ -668,14 +666,14 @@ int list_get_path_program_tree(DB *db, cklist *ckl, int bName, int attr) { } free(tmp); if (attr) { - /* secret */ - if (sqlite3_column_int(stmt2, 1)) { - strcat(treePath, " [s]"); - } /* primary */ if (sqlite3_column_int(stmt2, 2)) { strcat(treePath, " [p]"); } + /* secret */ + if (sqlite3_column_int(stmt2, 1)) { + strcat(treePath, " [s]"); + } /* root */ if (util_is_link_owned_by_root((char *)sqlite3_column_text(stmt2, 0))) { strcat(treePath, " [root]"); -- cgit v1.2.3