2002-02-17 21:56:45 +00:00
|
|
|
/*
|
2014-01-26 20:46:55 +00:00
|
|
|
* Copyright (c) 2001 Proofpoint, Inc. and its suppliers.
|
2002-02-17 21:56:45 +00:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* By using this file, you agree to the terms and conditions set
|
|
|
|
* forth in the LICENSE file which can be found at the top level of
|
|
|
|
* the sendmail distribution.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2000-08-12 21:55:49 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <sysexits.h>
|
|
|
|
|
2002-02-17 21:56:45 +00:00
|
|
|
#ifndef lint
|
2014-05-22 03:45:17 +00:00
|
|
|
static char id[] = "@(#)$Id: t_snprintf.c,v 8.5 2013-11-22 20:52:01 ca Exp $";
|
2002-02-17 21:56:45 +00:00
|
|
|
#endif /* ! lint */
|
|
|
|
|
2000-08-12 21:55:49 +00:00
|
|
|
#define TEST_STRING "1234567890"
|
|
|
|
|
|
|
|
int
|
|
|
|
main(argc, argv)
|
|
|
|
int argc;
|
|
|
|
char **argv;
|
|
|
|
{
|
|
|
|
int r;
|
|
|
|
char buf[5];
|
|
|
|
|
|
|
|
r = snprintf(buf, sizeof buf, "%s", TEST_STRING);
|
|
|
|
|
2001-08-01 01:33:27 +00:00
|
|
|
if (buf[sizeof buf - 1] != '\0' ||
|
|
|
|
r != strlen(TEST_STRING))
|
2000-08-12 21:55:49 +00:00
|
|
|
{
|
|
|
|
fprintf(stderr, "Add the following to devtools/Site/site.config.m4:\n\n");
|
|
|
|
fprintf(stderr, "APPENDDEF(`confENVDEF', `-DSNPRINTF_IS_BROKEN=1')\n\n");
|
|
|
|
exit(EX_OSERR);
|
|
|
|
}
|
|
|
|
fprintf(stderr, "snprintf() appears to work properly\n");
|
|
|
|
exit(EX_OK);
|
|
|
|
}
|