aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--charf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/charf.c b/charf.c
index b017532..1948971 100644
--- a/charf.c
+++ b/charf.c
@@ -160,8 +160,8 @@ int generate_each_charf(VALUETYPE* f, index_t i){
int d=2;
/*number of strings of length d that begin with 1 and end with 0*/
index_t powd = 1UL << d-2;
- while(i-s >= powd-1){
- s += powd-1;
+ while(i-s >= powd){
+ s += powd;
d++;
powd = powd << 1;
}