Skip to content

Commit 1f27c7d

Browse files
committed
add doc & error check
1 parent d1b14f2 commit 1f27c7d

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

helsing/src/main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ int main(int argc, char *argv[])
4747
goto out;
4848

4949
pthread_t *threads = malloc(sizeof(pthread_t) * options.threads);
50+
if (threads == NULL)
51+
abort();
5052
struct targs_handle *thhandle = NULL;
5153
targs_handle_new(&thhandle, options, interval.min, interval.max, progress);
5254

helsing/src/vampire/vargs.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,9 @@ void vampire(vamp_t min, vamp_t max, struct vargs *args, fang_t fmax)
189189
multiplicand++;
190190

191191
if (multiplicand <= multiplicand_max) {
192+
/*
193+
* If multiplier has n digits, then product_iterator has at most n+1 digits.
194+
*/
192195
vamp_t product_iterator = multiplier;
193196
product_iterator *= BASE - 1; // <= (BASE-1) * (2^32)
194197
vamp_t product = multiplier;

0 commit comments

Comments
 (0)