From deae06da9f6a9b99b20d33d0111c8f358e38f1a8 Mon Sep 17 00:00:00 2001 From: Jan Breuer <jan.breuer@jaybee.cz> Date: 周一, 10 8月 2015 20:08:37 +0800 Subject: [PATCH] Resolve #39: Correct handling of unsigned integers --- libscpi/src/utils.c | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/libscpi/src/utils.c b/libscpi/src/utils.c index 0a9de65..66dbc64 100644 --- a/libscpi/src/utils.c +++ b/libscpi/src/utils.c @@ -156,6 +156,19 @@ } /** + * Converts string to unsigned 32bit integer representation + * @param str string value + * @param val 32bit integer result + * @return number of bytes used in string + */ +size_t strToULong(const char * str, uint32_t * val, int8_t base) { + char * endptr; + *val = strtoul(str, &endptr, base); + return endptr - str; +} + + +/** * Converts string to double representation * @param str string value * @param val double result -- Gitblit v1.9.1