weston/shared
Bryce Harrington cbc053781e config-parser: Improve error checks for strtol/strtoul calls
Check errno, which is set of over/underflow, out of range, etc.  Also
check for empty strings (the usages covered in this patch already also
cover the case where there are non-digits present).  Set errno to 0
before making the strto*l call in case of pre-existing errors
(i.e. ENOTTY when running under the testsuite).

This follows the error checking style used in Wayland
(c.f. wayland-client.c and scanner.c).

In tests, also check errno, and add testcases for parsing '0'.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2016-07-08 11:10:38 -07:00
..
cairo-util.c Moved helper macro to a discrete include file. 2015-06-15 17:11:45 -07:00
cairo-util.h cairo-util: return theme location from frame_touch_down 2015-12-08 13:04:34 -06:00
config-parser.c config-parser: Improve error checks for strtol/strtoul calls 2016-07-08 11:10:38 -07:00
config-parser.h shared: Update boilerplate from MIT X11 license to MIT Expat license 2015-06-15 13:04:18 -07:00
file-util.c shared: Update boilerplate from MIT X11 license to MIT Expat license 2015-06-15 13:04:18 -07:00
file-util.h shared: Update boilerplate from MIT X11 license to MIT Expat license 2015-06-15 13:04:18 -07:00
frame.c cairo-util: return theme location from frame_touch_down 2015-12-08 13:04:34 -06:00
helpers.h Unified multiple definitions of container_of() macro. 2015-06-15 17:11:58 -07:00
image-loader.c configure: Make jpeglib an optional dependency. 2016-03-07 12:05:52 -08:00
image-loader.h shared: Update boilerplate from MIT X11 license to MIT Expat license 2015-06-15 13:04:18 -07:00
matrix.c shared: Update boilerplate from MIT X11 license to MIT Expat license 2015-06-15 13:04:18 -07:00
matrix.h shared: Update boilerplate from MIT X11 license to MIT Expat license 2015-06-15 13:04:18 -07:00
option-parser.c option-parser: Handle short double-arg options 2016-03-08 16:32:16 -08:00
os-compatibility.c log: Open log file CLOEXEC so child processes don't get the fd 2015-07-16 19:28:36 -07:00
os-compatibility.h log: Open log file CLOEXEC so child processes don't get the fd 2015-07-16 19:28:36 -07:00
platform.h platform: explicitly cast the return value of weston_platform_get_egl_proc_address 2016-03-08 23:23:26 -08:00
timespec-util.h compositor,shared: add millihz_to_nsec() 2015-07-16 13:55:05 +03:00
xalloc.c clients & tests: Unify multiple definitions of x*alloc and related functions 2016-03-17 14:13:13 +02:00
xalloc.h shared: Print .c file/line number in x* routines 2016-03-17 14:17:02 +02:00
zalloc.h shared: Update boilerplate from MIT X11 license to MIT Expat license 2015-06-15 13:04:18 -07:00