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.

51 lines
1.6 KiB

25 years ago
25 years ago
24 years ago
  1. /*
  2. +----------------------------------------------------------------------+
  3. | PHP Version 4 |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1997-2002 The PHP Group |
  6. +----------------------------------------------------------------------+
  7. | This source file is subject to version 2.02 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_02.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. | Author: Jaakko Hyvtti <jaakko.hyvatti@iki.fi> |
  16. +----------------------------------------------------------------------+
  17. */
  18. /* $Id$ */
  19. #include <stdio.h>
  20. #include <stdarg.h>
  21. #include "php_config.h"
  22. #if PHP_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 */
  37. /*
  38. * Local variables:
  39. * tab-width: 4
  40. * c-basic-offset: 4
  41. * End:
  42. * vim600: sw=4 ts=4 fdm=marker
  43. * vim<600: sw=4 ts=4
  44. */