Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Files for compil Simgrid with cmake and make a distrib with cpack.
[simgrid.git] / buildtools / CPACK / tmp / prog_snprintf.c
1 #include <stdio.h>
2
3 int main(void)
4 {
5     char bufs[5] = { 'x', 'x', 'x', '\0', '\0' };
6     char bufd[5] = { 'x', 'x', 'x', '\0', '\0' };
7     int i;
8     i = snprintf (bufs, 2, "%s", "111");
9     if (strcmp (bufs, "1")) exit (1);
10     if (i != 3) exit (1);
11     i = snprintf (bufd, 2, "%d", 111);
12     if (strcmp (bufd, "1")) exit (1);
13     if (i != 3) exit (1);
14     exit(0);
15 }