From 8eae2d81a4c962d298b07532e6211677ecf60339 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Sun, 19 Nov 2017 16:54:13 +0100 Subject: [PATCH] mlibc: Mescc-tools support: strtol: partly implement stub. * mlibc/libc-mes+tcc.c (strtol): Partly implement stub. --- mlibc/libc-mes+tcc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mlibc/libc-mes+tcc.c b/mlibc/libc-mes+tcc.c index 087253a2..9af01d97 100644 --- a/mlibc/libc-mes+tcc.c +++ b/mlibc/libc-mes+tcc.c @@ -309,7 +309,12 @@ long strtol (char const *nptr, char **endptr, int base) { eputs ("strtol stub\n"); - return 0; + if (!strncmp (nptr, "0x", 2)) + { + char const *p = nptr + 2; + return _atoi (&p, 16); + } + return _atoi (&nptr, base); } long long int