php-src/main/php_sprintf.c

51 lines
1.6 KiB
C
Raw Normal View History

1999-12-17 19:51:39 +00:00
/*
+----------------------------------------------------------------------+
2004-01-08 08:18:22 +00:00
| PHP Version 5 |
1999-12-17 19:51:39 +00:00
+----------------------------------------------------------------------+
2012-01-01 13:15:04 +00:00
| Copyright (c) 1997-2012 The PHP Group |
1999-12-17 19:51:39 +00:00
+----------------------------------------------------------------------+
2006-01-01 12:51:34 +00:00
| This source file is subject to version 3.01 of the PHP license, |
1999-12-17 19:51:39 +00:00
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
2006-01-01 12:51:34 +00:00
| http://www.php.net/license/3_01.txt |
1999-12-17 19:51:39 +00:00
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
2002-02-28 08:29:35 +00:00
| Author: Jaakko Hyv<EFBFBD>tti <jaakko.hyvatti@iki.fi> |
1999-12-17 19:51:39 +00:00
+----------------------------------------------------------------------+
*/
/* $Id$ */
#include <stdio.h>
#include <stdarg.h>
2004-11-15 21:04:09 +00:00
#include "php.h"
#ifdef PHP_WIN32
#include "config.w32.h"
#else
#include <php_config.h>
#endif
1999-12-17 19:51:39 +00:00
2004-11-15 21:04:09 +00:00
PHPAPI int
1999-12-17 19:51:39 +00:00
php_sprintf (char*s, const char* format, ...)
{
va_list args;
int ret;
1999-12-17 19:51:39 +00:00
va_start (args, format);
s[0] = '\0';
ret = vsprintf (s, format, args);
va_end (args);
2009-05-14 08:21:54 +00:00
return (ret < 0) ? -1 : ret;
1999-12-17 19:51:39 +00:00
}
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 fdm=marker
* vim<600: sw=4 ts=4
*/