uptodate with rainycrack

This commit is contained in:
owein 2020-11-14 14:20:00 +01:00 committed by yvain douard
commit 51a47c5cf6

13
bfg.c
View file

@ -200,15 +200,16 @@ uint64_t bf_get_pcount() {
} }
char *bf_next() { char *bf_next() {
int32_t i, pos = bf_options.current - 1;
if (bf_options.current > bf_options.to)
return NULL; // we are done
if ((bf_options.ptr = malloc(BF_CHARSMAX)) == NULL) { int accu(int x) {
fprintf(stderr, "Error: Can not allocate memory for -x data!\n"); int a = 0, b;
return NULL; for(b=1; b<x; ++b)
a+=b;
return a;
} }
char *bf_next(_Bool rainy) {
for (i = 0; i < bf_options.current; i++) for (i = 0; i < bf_options.current; i++)
bf_options.ptr[i] = bf_options.crs[bf_options.state[i]]; bf_options.ptr[i] = bf_options.crs[bf_options.state[i]];
bf_options.ptr[bf_options.current] = 0; bf_options.ptr[bf_options.current] = 0;