summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--auto_tests/crypto_test.c5
-rw-r--r--testing/toxic/prompt.c8
2 files changed, 13 insertions, 0 deletions
diff --git a/auto_tests/crypto_test.c b/auto_tests/crypto_test.c
index 6b9f6113..01c545c8 100644
--- a/auto_tests/crypto_test.c
+++ b/auto_tests/crypto_test.c
@@ -5,7 +5,12 @@
5#include <check.h> 5#include <check.h>
6#include <stdlib.h> 6#include <stdlib.h>
7#include <time.h> 7#include <time.h>
8#ifndef VANILLA_NACL
8#include <sodium.h> 9#include <sodium.h>
10#else
11#include <crypto_box.h>
12#define crypto_box_MACBYTES (crypto_box_ZEROBYTES - crypto_box_BOXZEROBYTES)
13#endif
9 14
10void rand_bytes(uint8_t *b, size_t blen) 15void rand_bytes(uint8_t *b, size_t blen)
11{ 16{
diff --git a/testing/toxic/prompt.c b/testing/toxic/prompt.c
index 473633d4..81f00bce 100644
--- a/testing/toxic/prompt.c
+++ b/testing/toxic/prompt.c
@@ -363,6 +363,11 @@ static void execute(ToxWindow *self, Messenger *m, char *u_cmd)
363 363
364 if (cmd[i] == ' ') { 364 if (cmd[i] == ' ') {
365 cmd[i] = '\0'; 365 cmd[i] = '\0';
366
367 int j = i;
368 while (++j < MAX_STR_SIZE && isspace(cmd[j]));
369 i = j - 1;
370
366 numargs++; 371 numargs++;
367 } 372 }
368 } 373 }
@@ -380,6 +385,9 @@ static void execute(ToxWindow *self, Messenger *m, char *u_cmd)
380 for (i = 0; i < 5; i++) { 385 for (i = 0; i < 5; i++) {
381 cmdargs[i] = cmd + pos; 386 cmdargs[i] = cmd + pos;
382 pos += strlen(cmdargs[i]) + 1; 387 pos += strlen(cmdargs[i]) + 1;
388
389 while (isspace(cmd[pos]) && pos < MAX_STR_SIZE)
390 ++pos;
383 } 391 }
384 392
385 /* no input */ 393 /* no input */