Fixed compatibility of output.
[AROS.git] / compiler / alib / sprintf.c
blobf78a698306554b0411c89e404b721d1f0a13a0a7
1 /*
2 Copyright © 1995-2016, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <exec/rawfmt.h>
7 #include <proto/exec.h>
8 #include <stdarg.h>
10 #ifdef __mc68000
11 const ULONG m68k_string_sprintf = 0x16c04e75;
12 #endif
14 /*****************************************************************************
16 NAME */
17 #include <proto/alib.h>
19 VOID __sprintf(
21 /* SYNOPSIS */
22 UBYTE *buffer, const UBYTE *format, ...)
24 /* FUNCTION
25 Print a formatted string to a buffer.
27 INPUTS
28 buffer -- the buffer to fill
29 format -- the format string, see the VNewRawDoFmt() documentation for
30 information on which formatting commands there are
32 RESULT
34 NOTES
36 EXAMPLE
38 BUGS
40 SEE ALSO
41 exec.library/VNewRawDoFmt()
43 INTERNALS
45 *****************************************************************************/
47 #ifdef __mc68000
48 /* Special case for m68k, so that we are AmigaOS 1.x/2.x compliant
49 * New programs should be using snprintf() from stdc.library
51 RawDoFmt(format, &format+1, (VOID_FUNC)&m68k_string_sprintf, buffer);
52 #else
53 va_list args;
55 va_start(args, format);
56 VNewRawDoFmt(format, RAWFMTFUNC_STRING, buffer, args);
57 va_end(args);
58 #endif
59 } /* sprintf */