added USE_SQLITE3 option
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Make (push) Successful in 12s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-CMake (push) Failing after 8s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Meson (push) Successful in 12s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Make (push) Successful in 12s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-CMake (push) Failing after 8s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Meson (push) Successful in 12s
This commit is contained in:
1 parent
634245e3ad
commit
73a73976fe
18 files changed
+115
-32
No files matched your search
@@ -5,6 +5,7 @@
|
||||
#include "user.h"
|
||||
|
||||
char *db_get_all_users() {
|
||||
#ifdef USE_SQLITE3
|
||||
pthread_mutex_lock(&db_mutex);
|
||||
if (!db) {
|
||||
fprintf(stderr, "Database not initialized\n");
|
||||
@@ -41,9 +42,9 @@ char *db_get_all_users() {
|
||||
const unsigned char *group = sqlite3_column_text(stmt, 4);
|
||||
int is_superuser = sqlite3_column_int(stmt, 5);
|
||||
|
||||
char *escaped_username = json_escape((const char *)username);
|
||||
char *escaped_email = json_escape((const char *)email);
|
||||
char *escaped_group = json_escape((const char *)group);
|
||||
char *escaped_username = json_escape((const char *) username);
|
||||
char *escaped_email = json_escape((const char *) email);
|
||||
char *escaped_group = json_escape((const char *) group);
|
||||
if (!escaped_username || !escaped_email || !escaped_group) {
|
||||
free(escaped_username);
|
||||
free(escaped_email);
|
||||
@@ -97,4 +98,7 @@ char *db_get_all_users() {
|
||||
sqlite3_finalize(stmt);
|
||||
pthread_mutex_unlock(&db_mutex);
|
||||
return result;
|
||||
}
|
||||
#else
|
||||
return "";
|
||||
#endif
|
||||
}
|
||||
Reference in new issue
Block a user