diff --git a/src/stdlib.c b/src/stdlib.c index 3d2507f..ce0a20b 100644 --- a/src/stdlib.c +++ b/src/stdlib.c @@ -3,6 +3,7 @@ #include #include #include +#include akerr_ErrorContext AKERR_NOIGNORE *aksl_malloc(size_t size, void **dst) { @@ -122,6 +123,7 @@ akerr_ErrorContext AKERR_NOIGNORE *aksl_sprintf(int *count, char *restrict str, FAIL_ZERO_RETURN(e, count, AKERR_NULLPOINTER, "count=%p, str=%p, format=%p", (void *)count, (void *)str, (void *)format); FAIL_ZERO_RETURN(e, str, AKERR_NULLPOINTER, "count=%p, str=%p, format=%p", (void *)count, (void *)str, (void *)format); FAIL_ZERO_RETURN(e, format, AKERR_NULLPOINTER, "count=%p, str=%p, format=%p", (void *)count, (void *)str, (void *)format); + va_start(args, format); *count = vsprintf(str, format, args); FAIL_NONZERO_RETURN(e, (*count == -1), errno, "Short write"); SUCCEED_RETURN(e); @@ -160,6 +162,6 @@ akerr_ErrorContext AKERR_NOIGNORE *aksl_realpath(const char *restrict path, char PREPARE_ERROR(e); FAIL_ZERO_RETURN(e, path, AKERR_NULLPOINTER, "path=%p, dest=%p", (void *)path, (void *)resolved_path); result = realpath(path, resolved_path); - FAIL_ZERO_RETURN(e, result, errno, "Error"); + FAIL_ZERO_RETURN(e, result, errno, "path=%s, dest=%s", path, resolved_path); SUCCEED_RETURN(e); }