X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/6d381ee57c7ed10b8bb134c8872456543feccfa9..fa50610ee612763f5414bf772956f4c254461ad7:/buildtools/CPACK/tmp/prog_snprintf.c diff --git a/buildtools/CPACK/tmp/prog_snprintf.c b/buildtools/CPACK/tmp/prog_snprintf.c new file mode 100644 index 0000000000..f24eb7c26d --- /dev/null +++ b/buildtools/CPACK/tmp/prog_snprintf.c @@ -0,0 +1,15 @@ +#include + +int main(void) +{ + char bufs[5] = { 'x', 'x', 'x', '\0', '\0' }; + char bufd[5] = { 'x', 'x', 'x', '\0', '\0' }; + int i; + i = snprintf (bufs, 2, "%s", "111"); + if (strcmp (bufs, "1")) exit (1); + if (i != 3) exit (1); + i = snprintf (bufd, 2, "%d", 111); + if (strcmp (bufd, "1")) exit (1); + if (i != 3) exit (1); + exit(0); +}