aboutsummaryrefslogtreecommitdiffstats
path: root/src/dblayer.c
diff options
context:
space:
mode:
authorgramanas <anastasis.gramm2@gmail.com>2018-11-10 22:47:03 +0200
committergramanas <anastasis.gramm2@gmail.com>2018-11-10 22:47:03 +0200
commit2638802ccd0d0776ebf1867181d4e3950a147074 (patch)
treecc535cc46c41d5dd347a7630f316cf1c84d00045 /src/dblayer.c
parent6d77eb748a6b15b9f473ab86371bfa474898cef1 (diff)
downloadck-2638802ccd0d0776ebf1867181d4e3950a147074.tar.gz
ck-2638802ccd0d0776ebf1867181d4e3950a147074.tar.bz2
ck-2638802ccd0d0776ebf1867181d4e3950a147074.zip
Home dir
Diffstat (limited to 'src/dblayer.c')
-rw-r--r--src/dblayer.c28
1 files changed, 13 insertions, 15 deletions
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]");