Skip to content

Commit

Permalink
add doc & error check
Browse files Browse the repository at this point in the history
  • Loading branch information
plerros committed Apr 9, 2022
1 parent d1b14f2 commit 1f27c7d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions helsing/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ int main(int argc, char *argv[])
goto out;

pthread_t *threads = malloc(sizeof(pthread_t) * options.threads);
if (threads == NULL)
abort();
struct targs_handle *thhandle = NULL;
targs_handle_new(&thhandle, options, interval.min, interval.max, progress);

Expand Down
3 changes: 3 additions & 0 deletions helsing/src/vampire/vargs.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ void vampire(vamp_t min, vamp_t max, struct vargs *args, fang_t fmax)
multiplicand++;

if (multiplicand <= multiplicand_max) {
/*
* If multiplier has n digits, then product_iterator has at most n+1 digits.
*/
vamp_t product_iterator = multiplier;
product_iterator *= BASE - 1; // <= (BASE-1) * (2^32)
vamp_t product = multiplier;
Expand Down

0 comments on commit 1f27c7d

Please sign in to comment.