-/* $Id: imports.c,v 1.16 2002/07/01 08:26:00 joukj Exp $ */
+/* $Id: imports.c,v 1.17 2002/08/01 15:10:23 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "imports.h"
#include "mem.h"
+#define MAXSTRING 4000 /* for vsnprintf() */
+
static void *
_mesa_Malloc(__GLcontext *gc, size_t size)
void
_mesa_warning(__GLcontext *gc, const char *fmtString, ...)
{
- char str[1000];
+ char str[MAXSTRING];
va_list args;
va_start( args, fmtString );
- (void) vsprintf( str, fmtString, args );
+ (void) vsnprintf( str, MAXSTRING, fmtString, args );
va_end( args );
warning(gc, str);
}
if (debug) {
va_list args;
- char where[1000];
+ char where[MAXSTRING];
const char *errstr;
va_start( args, fmtString );
- vsprintf( where, fmtString, args );
+ vsnprintf( where, MAXSTRING, fmtString, args );
va_end( args );
switch (error) {
void
_mesa_debug( const GLcontext *ctx, const char *fmtString, ... )
{
- char s[1000];
+ char s[MAXSTRING];
va_list args;
va_start(args, fmtString);
- vsprintf(s, fmtString, args);
+ vsnprintf(s, MAXSTRING, fmtString, args);
if (ctx)
(void) ctx->imports.fprintf( (__GLcontext *) ctx, stderr, s );
else
void
_mesa_printf( const GLcontext *ctx, const char *fmtString, ... )
{
- char s[1000];
+ char s[MAXSTRING];
va_list args;
va_start( args, fmtString );
- vsprintf(s, fmtString, args);
+ vsnprintf(s, MAXSTRING, fmtString, args);
if (ctx)
(void) ctx->imports.fprintf( (__GLcontext *) ctx, stdout, s );
else