File: snprintf.c

package info (click to toggle)
exifprobe 2.0.1%2Bgit20170416.3c2b769-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,900 kB
  • sloc: ansic: 34,799; sh: 413; makefile: 82
file content (16 lines) | stat: -rw-r--r-- 320 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <stdio.h>
#include <stdarg.h>

int snprintf(char *buffer, size_t count, const char *format, ...)
{
    int len;
    va_list args;
    va_start(args, format);
    len = vsnprintf(buffer, count, format, args);
    va_end(args);
    if (len < 0) {
        len = count + 1;
    }
    return len;
}