summaryrefslogtreecommitdiff
path: root/src/stdio/snprintf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stdio/snprintf.c')
-rw-r--r--src/stdio/snprintf.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/stdio/snprintf.c b/src/stdio/snprintf.c
index 44bb65fe..a6896c8a 100644
--- a/src/stdio/snprintf.c
+++ b/src/stdio/snprintf.c
@@ -4,15 +4,17 @@
int snprintf(char * restrict s, size_t n, const char * restrict format, ...)
{
- int ret = 0;
+ struct io_options opt = {
+ .fnname = __func__,
+ .string = s,
+ .maxlen = n,
+ };
+
va_list ap;
- struct io_options opt = {0};
- opt.fnname = __func__;
- opt.string = s;
- opt.maxlen = n;
va_start(ap, format);
- ret = __printf(&opt, format, ap);
+ int ret = __printf(&opt, format, ap);
va_end(ap);
+
return ret;
}