From 89973760e357aaf87b834f93e133ffb76b157d4b Mon Sep 17 00:00:00 2001 From: giraffedata Date: Tue, 29 Aug 2006 16:19:20 +0000 Subject: Add pm_errormsg(), pm_setusererrormsg(), pm_setusermessage(), release memory before longjmping git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@30 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- lib/util/Makefile | 2 +- lib/util/nstring.c | 9 --------- lib/util/nstring.h | 5 +++++ 3 files changed, 6 insertions(+), 10 deletions(-) (limited to 'lib/util') diff --git a/lib/util/Makefile b/lib/util/Makefile index 8f461f28..4ba60ba2 100644 --- a/lib/util/Makefile +++ b/lib/util/Makefile @@ -11,7 +11,7 @@ INCLUDES = -I $(BUILDDIR) -I $(SRCDIR)/$(SUBDIR)/.. # nstring is required for asprintf(), etc. Also some systems don't have # snprintf(), e.g. Solaris 2.5.1. 2002.03.29. -UTILOBJECTS = shhopt.o nstring.o filename.o +UTILOBJECTS = shhopt.o nstring.o vasprintf.o filename.o MERGE_OBJECTS = diff --git a/lib/util/nstring.c b/lib/util/nstring.c index 702a3c44..749e9060 100644 --- a/lib/util/nstring.c +++ b/lib/util/nstring.c @@ -740,15 +740,6 @@ const char * const strsol = "NO MEMORY TO CREATE STRING!"; -/* We would like to have vasprintfN(), but it is difficult because you - can't run through a va_list twice, which we would want to do: once - to measure the length; once actually to build the string. On some - machines, you can simply make two copies of the va_list variable in - normal C fashion, but on others you need va_copy, which is a - relatively recent invention. In particular, the simple va_list copy - failed on an AMD64 Gcc Linux system in March 2006. -*/ - void PM_GNU_PRINTF_ATTR(2,3) asprintfN(const char ** const resultP, const char * const fmt, diff --git a/lib/util/nstring.h b/lib/util/nstring.h index 9ed20051..d976e859 100644 --- a/lib/util/nstring.h +++ b/lib/util/nstring.h @@ -134,6 +134,11 @@ asprintfN(const char ** const resultP, const char * const fmt, ...) PM_GNU_PRINTF_ATTR(2,3); +void +vasprintfN(const char ** const resultP, + const char * const format, + va_list args); + void strfree(const char * const string); -- cgit 1.4.1