+ if (kilo) {
+ const char *p;
+ /*
+ * if the last char is 'b' or 'B', the user likely used
+ * "1gb" instead of just "1g". If the second to last is also
+ * a letter, adjust.
+ */
+ p = str + len - 1;
+ if ((*p == 'b' || *p == 'B') && isalpha(*(p - 1)))
+ --p;
+
+ *val *= get_mult_bytes(*p, data);
+ } else