diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2006-08-29 16:19:20 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2006-08-29 16:19:20 +0000 |
commit | 89973760e357aaf87b834f93e133ffb76b157d4b (patch) | |
tree | 2c24ce7e2601af9836726b0d5b91af8ef204c134 /lib/util | |
parent | 3821270a4899d4d9915bcc9f105b65b849467a3f (diff) | |
download | netpbm-mirror-89973760e357aaf87b834f93e133ffb76b157d4b.tar.gz netpbm-mirror-89973760e357aaf87b834f93e133ffb76b157d4b.tar.xz netpbm-mirror-89973760e357aaf87b834f93e133ffb76b157d4b.zip |
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
Diffstat (limited to 'lib/util')
-rw-r--r-- | lib/util/Makefile | 2 | ||||
-rw-r--r-- | lib/util/nstring.c | 9 | ||||
-rw-r--r-- | lib/util/nstring.h | 5 |
3 files changed, 6 insertions, 10 deletions
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); |