]> git.cworth.org Git - mnemon/blobdiff - mnemon.c
Print success count as it increments.
[mnemon] / mnemon.c
index 45e09308e53f017bfc63905463c1be7469ee387d..f80d67b10a15ede75c5095b005513dbb4622307e 100644 (file)
--- a/mnemon.c
+++ b/mnemon.c
@@ -372,7 +372,8 @@ mnemon_get_bin (mnemon_t    *mnemon,
     bin = &mnemon->bins[i];
 
     /* Make room to insert new bin at its sorted location. */
-    memmove (bin + 1, bin, (mnemon->num_bins - i) * sizeof (bin_t));
+    if (i < mnemon->num_bins)
+       memmove (bin + 1, bin, (mnemon->num_bins - i) * sizeof (bin_t));
     mnemon->num_bins++;
 
     bin_init (bin, count);
@@ -702,7 +703,7 @@ mnemon_do_challenges (mnemon_t *mnemon,
            } else if (item->count == 1) {
                printf ("On your first try, no less!");
            } else {
-               printf ("Masterful.");
+               printf ("Masterful (%dx).", item->count);
            }
        } else {
            printf ("  %s is the correct answer.",