~mingw-w64/mingw-w64/experimental

« back to all changes in this revision

Viewing changes to ros-privexp/mingw-w64-crt/stdio/mingw_snprintf.c

  • Committer: NightStrike
  • Date: 2010-08-11 22:20:57 UTC
  • Revision ID: svn-v4:4407c894-4637-0410-b4f5-ada5f102cad1:experimental:3266
Branch for adding option for supporting ros

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* snprintf.c
 
2
 *
 
3
 * $Id: snprintf.c,v 1.3 2008/07/28 23:24:20 keithmarshall Exp $
 
4
 *
 
5
 * Provides an implementation of the "snprintf" function, conforming
 
6
 * generally to C99 and SUSv3/POSIX specifications, with extensions
 
7
 * to support Microsoft's non-standard format specifications.  This
 
8
 * is included in libmingwex.a, replacing the redirection through
 
9
 * libmoldnames.a, to the MSVCRT standard "_snprintf" function; (the
 
10
 * standard MSVCRT function remains available, and may  be invoked
 
11
 * directly, using this fully qualified form of its name).
 
12
 *
 
13
 * Written by Keith Marshall <keithmarshall@users.sourceforge.net>
 
14
 *
 
15
 * This is free software.  You may redistribute and/or modify it as you
 
16
 * see fit, without restriction of copyright.
 
17
 *
 
18
 * This software is provided "as is", in the hope that it may be useful,
 
19
 * but WITHOUT WARRANTY OF ANY KIND, not even any implied warranty of
 
20
 * MERCHANTABILITY, nor of FITNESS FOR ANY PARTICULAR PURPOSE.  At no
 
21
 * time will the author accept any form of liability for any damages,
 
22
 * however caused, resulting from the use of this software.
 
23
 *
 
24
 */
 
25
 
 
26
#include <stdio.h>
 
27
#include <stdarg.h>
 
28
 
 
29
#include "mingw_pformat.h"
 
30
 
 
31
int __cdecl __snprintf (char *, size_t, const char *fmt, ...) __MINGW_NOTHROW;
 
32
int __cdecl __vsnprintf (char *, size_t, const char *fmt, va_list) __MINGW_NOTHROW;
 
33
 
 
34
int __cdecl __snprintf( char *buf, size_t length, const char *fmt, ... )
 
35
{
 
36
  va_list argv; va_start( argv, fmt );
 
37
  register int retval = __vsnprintf( buf, length, fmt, argv );
 
38
  va_end( argv );
 
39
  return retval;
 
40
}
 
41