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 @@ #include #include #include +#ifndef VANILLA_NACL #include +#else +#include +#define crypto_box_MACBYTES (crypto_box_ZEROBYTES - crypto_box_BOXZEROBYTES) +#endif void rand_bytes(uint8_t *b, size_t blen) { 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) if (cmd[i] == ' ') { cmd[i] = '\0'; + + int j = i; + while (++j < MAX_STR_SIZE && isspace(cmd[j])); + i = j - 1; + numargs++; } } @@ -380,6 +385,9 @@ static void execute(ToxWindow *self, Messenger *m, char *u_cmd) for (i = 0; i < 5; i++) { cmdargs[i] = cmd + pos; pos += strlen(cmdargs[i]) + 1; + + while (isspace(cmd[pos]) && pos < MAX_STR_SIZE) + ++pos; } /* no input */