Skip to content

Commit 4d22789

Browse files
committed
verify the assumption
1 parent b505973 commit 4d22789

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/solutions/count-1-bits.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#include <stdio.h>
66
#include <stdlib.h>
7+
#include <assert.h>
78
#include <err.h>
89

910
int
@@ -13,6 +14,7 @@ main(int argc, char *argv[])
1314
errx(1, "usage: %s <positive_num>", argv[0]);
1415

1516
int i = atoi(argv[1]);
17+
assert(i > 0);
1618
printf("0x%x\n", i);
1719
unsigned int ones = 0;
1820

0 commit comments

Comments
 (0)