From b8ef8b0dd28aa7d7536fa9c3cd430c4bb7671953 Mon Sep 17 00:00:00 2001 From: Andrew Kesterson Date: Mon, 25 May 2026 21:29:46 -0400 Subject: [PATCH] Added aksl_atof --- src/stdlib.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/stdlib.c b/src/stdlib.c index ce0a20b..b6cc060 100644 --- a/src/stdlib.c +++ b/src/stdlib.c @@ -156,6 +156,15 @@ akerr_ErrorContext AKERR_NOIGNORE *aksl_atoll(const char *nptr, long long *dest) SUCCEED_RETURN(e); } +akerr_ErrorContext AKERR_NOIGNORE *aksl_atof(const char *nptr, double *dest) +{ + PREPARE_ERROR(e); + FAIL_ZERO_RETURN(e, nptr, AKERR_NULLPOINTER, "nptr=%p, dest=%p", (void *)nptr, (void *)dest); + FAIL_ZERO_RETURN(e, dest, AKERR_NULLPOINTER, "nptr=%p, dest=%p", (void *)nptr, (void *)dest); + *dest = atof(nptr); + SUCCEED_RETURN(e); +} + akerr_ErrorContext AKERR_NOIGNORE *aksl_realpath(const char *restrict path, char *restrict resolved_path) { char *result = NULL;