rsys

Basic data structures and low-level features
git clone git://git.meso-star.fr/rsys.git
Log | Files | Refs | README | LICENSE

commit 7155d8bfc8a6a3024b60082600880bf7e72b00fc
parent 258bb8745389844e4a46a0dc3a473bb8a0e0807e
Author: vaplv <vaplv@free.fr>
Date:   Wed, 18 Nov 2015 14:33:54 +0100

Fix the cstr_to_uint routine

Internaly used the cstr_to_long and cast the result. This was correct only if
a long is strictly greater than an unsigned. Use the cstr_to_ulong instead.

Diffstat:
Msrc/cstr.h | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/cstr.h b/src/cstr.h @@ -110,10 +110,10 @@ cstr_to_ulong(const char* str, unsigned long* dst) static INLINE res_T cstr_to_uint(const char* str, unsigned* dst) { - long l; + unsigned long l; res_T res; ASSERT(dst); - res = cstr_to_long(str, &l); + res = cstr_to_ulong(str, &l); if (res != RES_OK) return res; #if UINT_MAX < ULONG_MAX