From: Ben Pfaff Date: Fri, 15 Nov 2013 18:34:34 +0000 (-0800) Subject: util: Fix bad constant in ovs_scan() implementation on 64-bit. X-Git-Tag: sliver-openvswitch-2.0.90-1~5^2~17 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=31499678a87ac344991572e0a8d9050f6c55f4cd;p=sliver-openvswitch.git util: Fix bad constant in ovs_scan() implementation on 64-bit. scan_chars() compares an "unsigned int" against SIZE_MAX, which will always be false on 64-bit architectures. The correct constant is UINT_MAX. Reported-by: Jarno Rajahalme Acked-by: Jarno Rajahalme Signed-off-by: Ben Pfaff --- diff --git a/lib/util.c b/lib/util.c index b63316666..c252886de 100644 --- a/lib/util.c +++ b/lib/util.c @@ -1497,7 +1497,7 @@ scan_set(const char *s, const struct scan_spec *spec, const char **pp, static const char * scan_chars(const char *s, const struct scan_spec *spec, va_list *args) { - unsigned int n = spec->width == SIZE_MAX ? 1 : spec->width; + unsigned int n = spec->width == UINT_MAX ? 1 : spec->width; if (strlen(s) < n) { return NULL;