From: handa Date: Fri, 18 Feb 2005 02:00:57 +0000 (+0000) Subject: (error_message): Allocate it statically. X-Git-Tag: REL-0-9-5~77 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=921533747756aab4493b905fdd6c0f0af8c09b60;p=m17n%2Flibotf.git (error_message): Allocate it statically. (otf__error): Don't allocate error_message dynamically. (OTF_perror): Adjust for the above changes. --- diff --git a/src/otferror.c b/src/otferror.c index a631c9b..36093fd 100644 --- a/src/otferror.c +++ b/src/otferror.c @@ -28,7 +28,7 @@ write to the Free Software Foundation, Inc., 59 Temple Place, Suite #include "otf.h" -static char *error_message; +static char error_message[1024]; int OTF_error; static char *error_string[] = @@ -46,8 +46,6 @@ 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; @@ -58,7 +56,7 @@ void 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