This improves code readability and maintainability without costing
anything.
Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
#include <string.h>
#include <stdlib.h>
+#include <ctype.h>
int dec_to_int(char *src, char **dst);
long long dec_to_longlong(char *src, char **dst);
static inline char *skip_non_numbers(char *str)
{
- while(((*str < '0') || (*str > '9')) && *str)
+ while(*str && !isdigit(*str))
str++;
return str;
static inline char *skip_numbers(char *str)
{
- while((*str >= '0') && (*str <= '9'))
+ while(isdigit(*str))
str++;
return str;