#include "otf.h"
-static char *error_message;
+static char error_message[1024];
int OTF_error;
static char *error_string[] =
int
otf__error (int err, char *fmt, void *arg)
{
- if (! error_message)
- error_message = (char *) malloc (1024);
sprintf (error_message, "OTF-Error (%s): ", error_string[err]);
sprintf (error_message + strlen (error_message), fmt, arg);
OTF_error = err;
OTF_perror (char *prefix)
{
if (OTF_error == 0)
- error_message = error_string[0];
+ sprintf (error_message, "%s", error_string[0]);
if (prefix)
fprintf (stderr, "%s: %s\n", prefix, error_message);
else