You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.5 KiB

27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
  1. /*
  2. +----------------------------------------------------------------------+
  3. | PHP version 4.0 |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1997, 1998, 1999 The PHP Group |
  6. +----------------------------------------------------------------------+
  7. | This source file is subject to version 2.0 of the PHP license, |
  8. | that is bundled with this package in the file LICENSE, and is |
  9. | available at through the world-wide-web at |
  10. | http://www.php.net/license/2_0.txt. |
  11. | If you did not receive a copy of the PHP license and are unable to |
  12. | obtain it through the world-wide-web, please send a note to |
  13. | license@php.net so we can mail you a copy immediately. |
  14. +----------------------------------------------------------------------+
  15. | Authors: Jaakko Hyvtti <jaakko.hyvatti@iki.fi> |
  16. +----------------------------------------------------------------------+
  17. */
  18. /* $Id$ */
  19. #include "php_config.h"
  20. #include <stdio.h>
  21. #include <stdarg.h>
  22. #if BROKEN_SPRINTF
  23. int
  24. php_sprintf (char*s, const char* format, ...)
  25. {
  26. va_list args;
  27. char *ret;
  28. va_start (args, format);
  29. s[0] = '\0';
  30. ret = vsprintf (s, format, args);
  31. va_end (args);
  32. if (!ret)
  33. return -1;
  34. return strlen (s);
  35. }
  36. #endif /* BROKEN_SPRINTF */