diff options
author | FreeArtMan <dos21h@gmail.com> | 2017-11-25 09:41:42 +0000 |
---|---|---|
committer | FreeArtMan <dos21h@gmail.com> | 2017-11-25 09:41:42 +0000 |
commit | 3967218650a2c03304533c4e8b32e86c8b38a48a (patch) | |
tree | fdb1a35522a60607b2d2efb4bc06083272864939 /cmd | |
parent | aee6daa406af77c16e209927f51e56034be6d773 (diff) | |
download | agni-3967218650a2c03304533c4e8b32e86c8b38a48a.tar.gz agni-3967218650a2c03304533c4e8b32e86c8b38a48a.zip |
Bug in todo handling usernames, needed to use base64 encoded username
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/cmd_todo.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cmd/cmd_todo.c b/cmd/cmd_todo.c index 78dc8b5..079866e 100644 --- a/cmd/cmd_todo.c +++ b/cmd/cmd_todo.c @@ -145,18 +145,20 @@ static int del_todo(sqlite3 *db, char *user, int id) char *b64_user; b64_user = b64_encode(user, strlen(user)); - snprintf(sql_del_table, 1024, "DELETE FROM todo WHERE user='%s' AND id=%d;", user, id); + snprintf(sql_del_table, 1024, "DELETE FROM todo WHERE user='%s' AND id=%d;", b64_user, id); free(b64_user); + PRINT("%s\n",sql_del_table); if ((rc = sqlite3_exec(db, sql_del_table, 0, 0, &err_msg )) != SQLITE_OK) { printf("Cant del todo: %s\n", err_msg); sqlite3_free(err_msg); - + PNL(); return -1; } + PNL(); return 0; } @@ -284,6 +286,7 @@ void *cmd_todo(void *data) if (count > 2) { int id = atoi(tokens[2]); + PRINT("%d\n",id); del_todo(db, req->user, id); } |