diff options
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); } |