File: snprintf.h

package info (click to toggle)
libjna-java 5.15.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 11,828 kB
  • sloc: java: 90,222; ansic: 4,994; xml: 3,713; makefile: 433; sh: 299
file content (15 lines) | stat: -rw-r--r-- 440 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#ifndef _SNPRINTF_H
#define _SNPRINTF_H
#if _MSC_VER < 1900 // Before Visual Studio 2015
// snprintf on windows is broken; always nul-terminate manually
// DO NOT rely on the return value...
static int snprintf(char * str, size_t size, const char * format, ...) {
  int retval;
  va_list ap;
  va_start(ap, format);
  retval = _vsnprintf_s(str, size, _TRUNCATE, format, ap);
  va_end(ap);
  return retval;
}
#endif
#endif /* _SNPRINTF_H */