Tests: fix TAP_AUTOTIME parsing in tap.c
authorMichael Jeanson <mjeanson@efficios.com>
Thu, 29 Feb 2024 19:34:14 +0000 (14:34 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 29 Feb 2024 20:03:01 +0000 (15:03 -0500)
commit01076722667ada7b84d366c26977f014aefd3ebc
treecf172def9227e0578a342b6796e372427c17f0f3
parentb26c3b64ce249d0d1f8055519cd648d1a0bcc0da
Tests: fix TAP_AUTOTIME parsing in tap.c

The atoi() function can return '0' on error and is not guaranteed to set
errno accordingly. Use strtol() instead which can also return 0 on error
but will set errno properly.

Check errno after the function call to distinguish between the value '0'
and the error code '0'.

Change-Id: I5a82bb0f18d7e398dc3594aede5a38e6fc10dd7b
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
tests/utils/tap/tap.c
This page took 0.024979 seconds and 4 git commands to generate.