GRASS GIS 7 Programmer's Manual
7.0.3(2016)-r00000
Main Page
Related Pages
Data Structures
Files
File List
Globals
snprintf.c
Go to the documentation of this file.
1
23
#include <stdio.h>
24
#include <stdlib.h>
25
#include <stdarg.h>
26
#include <unistd.h>
27
#include <assert.h>
28
#include <grass/gis.h>
29
43
int
G_snprintf
(
char
*str,
size_t
size,
const
char
*fmt, ...)
44
{
45
va_list ap;
46
int
count
;
47
48
va_start(ap, fmt);
49
count = vsnprintf(str, size, fmt, ap);
50
va_end(ap);
51
52
/* Windows' vsnprintf() doesn't always NUL-terminate the buffer */
53
if
(count == size)
54
str[--
count
] =
'\0'
;
55
56
return
count
;
57
}
count
int count
G_snprintf
int G_snprintf(char *str, size_t size, const char *fmt,...)
snprintf() clone.
Definition:
snprintf.c:43
gis
snprintf.c
Generated on Tue Mar 29 2016 20:03:26 for GRASS GIS 7 Programmer's Manual by
1.8.11