summaryrefslogtreecommitdiff
path: root/testing/toxic
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2013-08-15 20:56:22 -0400
committerirungentoo <irungentoo@gmail.com>2013-08-15 20:56:22 -0400
commitb15230583c31799d650584b05f4cfce8cd726aea (patch)
treec9d56f3fd9bad409374302e6eb92e9343cb859c1 /testing/toxic
parent36cb9b003d2f9e8162c39ffa3ab1afa3743b13a4 (diff)
Fixed loading and a small problem with the length of crypto requests.
Diffstat (limited to 'testing/toxic')
-rw-r--r--testing/toxic/main.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/testing/toxic/main.c b/testing/toxic/main.c
index 4d52469a..38c20df6 100644
--- a/testing/toxic/main.c
+++ b/testing/toxic/main.c
@@ -147,6 +147,8 @@ static void do_tox(Messenger *m, ToxWindow * prompt)
147 doMessenger(m); 147 doMessenger(m);
148} 148}
149 149
150int f_loadfromfile;
151
150/* 152/*
151 * Store Messenger to given location 153 * Store Messenger to given location
152 * Return 0 stored successfully 154 * Return 0 stored successfully
@@ -156,6 +158,8 @@ static void do_tox(Messenger *m, ToxWindow * prompt)
156 */ 158 */
157int store_data(Messenger *m, char *path) 159int store_data(Messenger *m, char *path)
158{ 160{
161 if (f_loadfromfile == 0) /*If file loading/saving is disabled*/
162 return 0;
159 FILE *fd; 163 FILE *fd;
160 size_t len; 164 size_t len;
161 uint8_t *buf; 165 uint8_t *buf;
@@ -186,6 +190,8 @@ int store_data(Messenger *m, char *path)
186 190
187static void load_data(Messenger *m, char *path) 191static void load_data(Messenger *m, char *path)
188{ 192{
193 if (f_loadfromfile == 0) /*If file loading/saving is disabled*/
194 return;
189 FILE *fd; 195 FILE *fd;
190 size_t len; 196 size_t len;
191 uint8_t *buf; 197 uint8_t *buf;
@@ -233,7 +239,7 @@ int main(int argc, char *argv[])
233 char *user_config_dir = get_user_config_dir(); 239 char *user_config_dir = get_user_config_dir();
234 int config_err = 0; 240 int config_err = 0;
235 241
236 int f_loadfromfile = 1; 242 f_loadfromfile = 1;
237 int f_flag = 0; 243 int f_flag = 0;
238 int i = 0; 244 int i = 0;
239 for (i = 0; i < argc; ++i) { 245 for (i = 0; i < argc; ++i) {