printf 0.1.0

A library to convert a fmt string and va_list into rust String
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14

#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>

char* printf_wrapper(char* format, va_list args) {
    va_list cpy;
    va_copy(cpy, args);
    int size = vsnprintf(0, 0, format, cpy);
    char* out = malloc(size + 1);
    vsprintf(out, format, args);
    va_end(cpy);
    return out;
}