Merge pull request #334 from bsilver8192/master

Various small cleanups
This commit is contained in:
Frank Denis
2015-12-17 09:38:31 +01:00
3 changed files with 7 additions and 3 deletions
+3 -1
View File
@@ -56,7 +56,9 @@ prompt_input(const char *prompt, char *input, const size_t max_input_len,
printf("\nEnter %s (%zu bytes) > ", prompt, max_input_len);
}
fflush(stdout);
fgets(input_tmp, sizeof input_tmp, stdin);
if (fgets(input_tmp, sizeof input_tmp, stdin) == NULL) {
input_tmp[0] = '\0';
}
actual_input_len = strlen(input_tmp);
/* trim \n */
@@ -86,7 +86,9 @@ sodium_hrtime(void)
#else
{
struct timeval tv;
assert(gettimeofday(&tv, NULL) == 0);
int ret = gettimeofday(&tv, NULL);
(void)ret;
assert(ret == 0);
ts = ((uint64_t) tv.tv_sec) * 1000000U + (uint64_t) tv.tv_usec;
}
#endif
+1 -1
View File
@@ -15,7 +15,7 @@ static unsigned char a2[crypto_auth_hmacsha512_BYTES];
int main(void)
{
crypto_auth_hmacsha512_state st;
int i;
size_t i;
assert(crypto_auth_hmacsha512_statebytes() ==
sizeof(crypto_auth_hmacsha512_state));