Skip to content
Snippets Groups Projects
Commit 3c3f87c0 authored by Avi Kivity's avatar Avi Kivity
Browse files

libc: implement sprintf()

parent 9672e5dd
No related branches found
No related tags found
No related merge requests found
......@@ -322,3 +322,14 @@ int vsnprintf(char *str, size_t size, const char *format, va_list ap)
*last = '\0';
return out.length();
}
int sprintf(char* str, const char* format, ...)
{
va_list ap;
va_start(ap, format);
auto out = strprintf(format, ap);
va_end(ap);
std::copy(out.begin(), out.end(), str);
return out.length();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment