mangle: resize, assign more weight to smaller changes
@@ -608,24 +608,24 @@ static void mangle_Resize(run_t* run, bool printable) {
ssize_t oldsz = run->dynamicFileSz;
ssize_t newsz = 0;
- uint64_t choice = util_rndGet(0, 12);
+ uint64_t choice = util_rndGet(0, 27);
switch (choice) {
- case 0 ... 7: /* Do nothing */
+ case 0 ... 16: /* Do nothing */
newsz = oldsz;
break;
- case 8: /* Set new size arbitrarily */
+ case 17: /* Set new size arbitrarily */
newsz = (ssize_t)util_rndGet(1, run->global->mutate.maxInputSz);
break;
- case 9: /* Increase size by a small value */
- newsz = oldsz + (ssize_t)util_rndGet(1, 8);
+ case 18 ... 21: /* Increase size by a small value */
+ newsz = oldsz + (ssize_t)util_rndGet(0, 8);
break;
- case 10: /* Increase size by a larger value */
+ case 22: /* Increase size by a larger value */
newsz = oldsz + (ssize_t)util_rndGet(9, 128);
break;
- case 11: /* Decrease size by a small value */
- newsz = oldsz - (ssize_t)util_rndGet(1, 8);
+ case 23 ... 26: /* Decrease size by a small value */
+ newsz = oldsz - (ssize_t)util_rndGet(0, 8);
break;
- case 12: /* Decrease size by a larger value */
+ case 27: /* Decrease size by a larger value */
newsz = oldsz - (ssize_t)util_rndGet(9, 128);
break;
default:
