remove debug code from client and library

This commit is contained in:
Florian Stinglmayr 2019-07-20 13:44:18 +02:00
parent 08d1fcc15d
commit 6eff70d415
3 changed files with 11 additions and 1 deletions

View File

@ -25,7 +25,11 @@
#include <dc/refable.h> #include <dc/refable.h>
#include <dc/account.h> #include <dc/account.h>
#define DEBUG /* For internal debugging only. Please note that the client will then begin to
* write text files everywhere filled with all sorts of private information. Use
* with caution.
*/
/*#define DEBUG*/
#define return_if_true(v,r) do { if (v) return r; } while(0) #define return_if_true(v,r) do { if (v) return r; } while(0)
#define goto_if_true(v,l) do { if (v) goto l; } while(0) #define goto_if_true(v,l) do { if (v) goto l; } while(0)

View File

@ -182,12 +182,14 @@ static void dc_session_handler(dc_gateway_t gw, dc_event_t e, void *p)
h(s, e); h(s, e);
} }
#ifdef DEBUG
char *str = NULL; char *str = NULL;
str = json_dumps(dc_event_payload(e), 0); str = json_dumps(dc_event_payload(e), 0);
FILE *f = fopen("events.txt", "a+"); FILE *f = fopen("events.txt", "a+");
fprintf(f, "%s: %s\n", dc_event_type(e), str); fprintf(f, "%s: %s\n", dc_event_type(e), str);
free(str); free(str);
fclose(f); fclose(f);
#endif
} }
dc_session_t dc_session_new(dc_loop_t loop) dc_session_t dc_session_new(dc_loop_t loop)

View File

@ -382,16 +382,20 @@ void ncdc_mainwindow_input_ready(ncdc_mainwindow_t n)
} }
keylen = wcslen(key); keylen = wcslen(key);
#if 0
FILE *f = fopen("keys.txt", "a+"); FILE *f = fopen("keys.txt", "a+");
fwprintf(f, L"KEY: %02X %ls\n", fwprintf(f, L"KEY: %02X %ls\n",
key[0], &key[1] key[0], &key[1]
); );
fclose(f); fclose(f);
#endif
} }
#if 0
FILE *f = fopen("keys.txt", "a+"); FILE *f = fopen("keys.txt", "a+");
fwprintf(f, L"%X\n", i); fwprintf(f, L"%X\n", i);
fclose(f); fclose(f);
#endif
if (key != NULL && if (key != NULL &&
(k = ncdc_find_keybinding(keys_global, key, keylen)) != NULL) { (k = ncdc_find_keybinding(keys_global, key, keylen)) != NULL) {