[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2 1/3] xen: introduce parse_size_and_unit_or_int



>>> On 06.12.18 at 09:06, <jgross@xxxxxxxx> wrote:
> @@ -477,7 +478,8 @@ unsigned long long parse_size_and_unit(const char *s, 
> const char **ps)
>          s1++;
>          break;
>      default:
> -        ret <<= 10; /* default to kB */
> +        if ( *s1 && *s1 != no_size )
> +            ret <<= 10; /* default to kB */
>          break;

So did you figure anything wrong with simply special casing '%'
here? '%' is a form of "unit", after all. Perhaps demanding "ps"
to be non-NULL (to have some form of indication the caller will
check the suffix char) might be reasonable.

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.