Modify parse_size_and_unit() to support a value followed by a '%'
character. In this case ps is required to be non-NULL to ensure the
caller can detect that case. The returned value will be the integer
value s was pointing to and *ps will point to the '%' character.
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
case 'B': case 'b':
s1++;
break;
+ case '%':
+ if ( ps )
+ break;
+ /* fallthrough */
default:
ret <<= 10; /* default to kB */
break;