Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/io/asprintf.c

    rcca2d93b ra35b458  
    5151}
    5252
    53 int vprintf_length(const char *fmt, va_list args)
     53int vprintf_size(const char *fmt, va_list args)
    5454{
    5555        printf_spec_t ps = {
     
    6262}
    6363
    64 int printf_length(const char *fmt, ...)
     64int printf_size(const char *fmt, ...)
    6565{
    6666        va_list args;
    6767        va_start(args, fmt);
    68         int ret = vprintf_length(fmt, args);
     68        int ret = vprintf_size(fmt, args);
    6969        va_end(args);
    7070
     
    8686        va_list args2;
    8787        va_copy(args2, args);
    88         int ret = vsnprintf(NULL, 0, fmt, args2);
     88        int ret = vprintf_size(fmt, args2);
    8989        va_end(args2);
    9090
    9191        if (ret > 0) {
    92                 *strp = malloc(ret + 1);
     92                *strp = malloc(STR_BOUNDS(ret) + 1);
    9393                if (*strp == NULL)
    9494                        return -1;
    9595
    96                 vsnprintf(*strp, ret + 1, fmt, args);
     96                vsnprintf(*strp, STR_BOUNDS(ret) + 1, fmt, args);
    9797        }
    9898
Note: See TracChangeset for help on using the changeset viewer.