php-src/main/php_sprintf.c

51 lines
1.6 KiB
C
Raw Normal View History

1999-12-18 03:51:39 +08:00
/*
+----------------------------------------------------------------------+
2004-01-08 16:18:22 +08:00
| PHP Version 5 |
1999-12-18 03:51:39 +08:00
+----------------------------------------------------------------------+
2011-01-01 10:17:06 +08:00
| Copyright (c) 1997-2011 The PHP Group |
1999-12-18 03:51:39 +08:00
+----------------------------------------------------------------------+
2006-01-01 20:51:34 +08:00
| This source file is subject to version 3.01 of the PHP license, |
1999-12-18 03:51:39 +08: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 20:51:34 +08:00
| http://www.php.net/license/3_01.txt |
1999-12-18 03:51:39 +08: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 16:29:35 +08:00
| Author: Jaakko Hyv<EFBFBD>tti <jaakko.hyvatti@iki.fi> |
1999-12-18 03:51:39 +08:00
+----------------------------------------------------------------------+
*/
/* $Id$ */
#include <stdio.h>
#include <stdarg.h>
2004-11-16 05:04:09 +08:00
#include "php.h"
#ifdef PHP_WIN32
#include "config.w32.h"
#else
#include <php_config.h>
#endif
1999-12-18 03:51:39 +08:00
2004-11-16 05:04:09 +08:00
PHPAPI int
1999-12-18 03:51:39 +08:00
php_sprintf (char*s, const char* format, ...)
{
va_list args;
int ret;
1999-12-18 03:51:39 +08:00
va_start (args, format);
s[0] = '\0';
ret = vsprintf (s, format, args);
va_end (args);
2009-05-14 16:21:54 +08:00
return (ret < 0) ? -1 : ret;
1999-12-18 03:51:39 +08:00
}
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 fdm=marker
* vim<600: sw=4 ts=4
*/