From 54ad1a4c1dd39657a416fb98cc036247f6f939f2 Mon Sep 17 00:00:00 2001 From: Vincent Torri Date: Tue, 28 Aug 2012 06:18:53 +0000 Subject: [PATCH] Evil: fix evil_format_message() SVN revision: 75749 --- legacy/evil/ChangeLog | 13 ++++++------- legacy/evil/NEWS | 5 +++++ legacy/evil/src/lib/evil_util.c | 9 ++++++--- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/legacy/evil/ChangeLog b/legacy/evil/ChangeLog index 5309861..5591439 100644 --- a/legacy/evil/ChangeLog +++ b/legacy/evil/ChangeLog @@ -1,13 +1,11 @@ 2012-08-20 Vincent Torri - * configure.ac: - quoting. - - * Makefile.am: - * src/lib/Makefile.am: - fix distcheck + * src/lib/evil_util.c: + fix evil_format_message(): free the message to display + at the end of the function. Hence the message is displayed, + now. -2012-08-19 Vincent Torri +012-08-19 Vincent Torri * configure.ac: * src/bin/Makefile.am: @@ -43,6 +41,7 @@ * NEWS: * src/lib/evil_langinfo.c: + Release Version 1.1.0. Fix nl_langinfo(RADIXCHAR). 2012-04-20 Vincent Torri diff --git a/legacy/evil/NEWS b/legacy/evil/NEWS index adfbcea..7838617 100644 --- a/legacy/evil/NEWS +++ b/legacy/evil/NEWS @@ -1,7 +1,12 @@ Evil NEWS - User visible changes. +* Evil 1.7: + +** Correctly display messages with evil_format_message() + * Evil 1.1: +** Released April 26th, 2012, by Vincent Torri ** Add evil_path_is_absolute() API ** Add POSIX printf() family functions ** Add S_ISLNK macro diff --git a/legacy/evil/src/lib/evil_util.c b/legacy/evil/src/lib/evil_util.c index 84e8f31..ad42559 100644 --- a/legacy/evil/src/lib/evil_util.c +++ b/legacy/evil/src/lib/evil_util.c @@ -142,11 +142,12 @@ evil_format_message(long err) str = msg; #endif /* UNICODE */ - LocalFree(msg); - disp = (char *)malloc((strlen(str) + strlen("(00000) ") + 1) * sizeof(char)); if (!disp) - return NULL; + { + LocalFree(msg); + return NULL; + } snprintf(disp, strlen(str) + strlen("(00000) ") + 1, "(%5ld) %s", err, str); @@ -155,6 +156,8 @@ evil_format_message(long err) free(str); #endif /* UNICODE */ + LocalFree(msg); + return disp; } -- 2.7.4