aboutsummaryrefslogtreecommitdiff
path: root/sand-leek.c
diff options
context:
space:
mode:
authorDavid Phillips <david@sighup.nz>2017-05-23 14:36:12 +1200
committerDavid Phillips <david@sighup.nz>2017-05-23 14:36:12 +1200
commit4995b5fe9a01a10b2487bd73bb214a4584bc4c1c (patch)
treef7909e6a7be84a940f2952da97ea9c53971a896c /sand-leek.c
parent91576b381d9f4d714dc9a7f559ca9d13898e01e3 (diff)
downloadsand-leek-4995b5fe9a01a10b2487bd73bb214a4584bc4c1c.tar.xz
Fix bug in check_base32 when first character was invalid
Diffstat (limited to 'sand-leek.c')
-rw-r--r--sand-leek.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sand-leek.c b/sand-leek.c
index 899726a..8554960 100644
--- a/sand-leek.c
+++ b/sand-leek.c
@@ -284,7 +284,7 @@ main(int argc, char **argv) {
int opt = '\0';
int thread_count = 1;
int i = 0;
- size_t offset = 0;
+ ssize_t offset = 0;
pthread_t *workers = NULL;
unsigned long volatile *khashes = NULL;
@@ -312,7 +312,7 @@ main(int argc, char **argv) {
search_len = strlen(search);
- if ((offset = check_base32(search))) {
+ if ((offset = check_base32(search)) >= 0) {
fprintf(stderr,
"Error: search contains non-base-32 character(s): %c\n"
"I cannot search for something that will never occur\n",