Skip to content

Commit

Permalink
* stdio.c: Add wrapper for C99's snprintf(3).
Browse files Browse the repository at this point in the history
svn path=/trunk/mono/; revision=38326
Jonathan Pryor committed Jan 4, 2005
1 parent 5cc386c commit 892f985
Showing 2 changed files with 21 additions and 0 deletions.
4 changes: 4 additions & 0 deletions support/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2005-01-04 Jonathan Pryor <[email protected]>

* stdio.c: Add wrapper for C99's snprintf(3).

2005-01-04 Jonathan Pryor <[email protected]>

* Makefile.am: Rewrite. Remove configure-generated warnings about
17 changes: 17 additions & 0 deletions support/stdio.c
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@
* Copyright (C) 2004-2005 Jonathan Pryor
*/

#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>

@@ -46,6 +47,22 @@ Mono_Posix_Stdlib_fwrite (const void *ptr, mph_size_t size, mph_size_t nmemb, FI
return fwrite (ptr, (size_t) size, (size_t) nmemb, stream);
}

#ifdef HAVE_VSNPRINTF
gint32
Mono_Posix_Stdlib_snprintf (char *s, mph_size_t n, char *format, ...)
{
va_list ap;
gint32 r;
mph_return_if_size_t_overflow (n);

va_start (ap, format);
r = vsnprintf (s, (size_t) n, format, ap);
va_end (ap);

return r;
}
#endif /* def HAVE_SNPRINTF */

gint32
Mono_Posix_Stdlib__IOFBF (void)
{

0 comments on commit 892f985

Please sign in to comment.