A buffer variable wasn't dereferenced in two similar comparisons in ResList
[AROS.git] / compiler / alib / sprintf.c
blobea96585204aed5f3c73ccd9cb4d9031cede2f08f
1 /*
2 Copyright © 1995-2008, 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 HISTORY
46 07.01.2000 SDuvan implemented
48 *****************************************************************************/
50 #ifdef __mc68000
51 /* Special case for m68k, so that we are AmigaOS 1.x/2.x compliant
52 * New programs should be using snprintf() from arosc.library
54 RawDoFmt(format, &format+1, (VOID_FUNC)&m68k_string_sprintf, buffer);
55 #else
56 va_list args;
58 va_start(args, format);
59 VNewRawDoFmt(format, RAWFMTFUNC_STRING, buffer, args);
60 va_end(args);
61 #endif
62 } /* sprintf */