mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-18 23:28:29 +00:00
committed by
Christian Helmuth
parent
d884cf1a9a
commit
d9d65aa86b
@ -16,6 +16,6 @@
|
||||
extern "C" long atol(const char *nptr)
|
||||
{
|
||||
long result = 0;
|
||||
Genode::ascii_to(nptr, &result);
|
||||
Genode::ascii_to(nptr, result);
|
||||
return result;
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ extern "C" double strtod(const char *nptr, char **endptr)
|
||||
{
|
||||
double value = 0;
|
||||
|
||||
int num_chars = Genode::ascii_to(nptr, &value);
|
||||
int num_chars = Genode::ascii_to(nptr, value);
|
||||
|
||||
if (endptr)
|
||||
*endptr = (char *)(nptr + num_chars);
|
||||
|
@ -12,17 +12,21 @@
|
||||
*/
|
||||
|
||||
#include <util/string.h>
|
||||
#include <base/printf.h>
|
||||
|
||||
using namespace Genode;
|
||||
|
||||
extern "C" long int strtol(const char *nptr, char **endptr, int base)
|
||||
{
|
||||
long num_chars, result = 0;
|
||||
using namespace Genode;
|
||||
|
||||
if (base == 0)
|
||||
num_chars = ascii_to(nptr, &result);
|
||||
else
|
||||
num_chars = ascii_to(nptr, &result, base);
|
||||
long result = 0;
|
||||
|
||||
if (base != 0 && base != 10) {
|
||||
PERR("strtol: base of %d not supported", base);
|
||||
return 0;
|
||||
}
|
||||
|
||||
long const num_chars = ascii_to(nptr, result);
|
||||
|
||||
if (endptr)
|
||||
*endptr = (char *)(nptr + num_chars);
|
||||
|
Reference in New Issue
Block a user