Merge branch 'master' into refactor

This commit is contained in:
irungentoo 2013-08-20 11:59:06 -04:00
commit 9f0efe9201
2 changed files with 13 additions and 0 deletions

View File

@ -5,7 +5,12 @@
#include <check.h>
#include <stdlib.h>
#include <time.h>
#ifndef VANILLA_NACL
#include <sodium.h>
#else
#include <crypto_box.h>
#define crypto_box_MACBYTES (crypto_box_ZEROBYTES - crypto_box_BOXZEROBYTES)
#endif
void rand_bytes(uint8_t *b, size_t blen)
{

View File

@ -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 */