summaryrefslogtreecommitdiffstats
path: root/libopkg/sprintf_alloc.h
diff options
context:
space:
mode:
authorgraham.gower@gmail.com <graham.gower@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2010-11-18 22:55:52 (EST)
committer graham.gower@gmail.com <graham.gower@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2010-11-18 22:55:52 (EST)
commit7e8e45766b6fbf8c3ea443646af259f2943e4ef2 (patch)
treecfbabced3adf098d3b22cceab9c5a69b8cdd70b4 /libopkg/sprintf_alloc.h
parent6ee4d7075a8d19f1b465bd2d222a182c1d8345e7 (diff)
Rewrite sprintf_alloc.
The example in printf(3) that this was taken from should not be used as it ignores negative return codes from vsnprintf, instead allocating more memory. Given an error from vsnprintf, this would loop until the process' virtual memory is exhausted. So we just exit in the event of a problem instead. git-svn-id: http://opkg.googlecode.com/svn/trunk@581 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
Diffstat (limited to 'libopkg/sprintf_alloc.h')
-rw-r--r--libopkg/sprintf_alloc.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/libopkg/sprintf_alloc.h b/libopkg/sprintf_alloc.h
index 3d68d69..bcf42a4 100644
--- a/libopkg/sprintf_alloc.h
+++ b/libopkg/sprintf_alloc.h
@@ -18,6 +18,6 @@
#ifndef SPRINTF_ALLOC_H
#define SPRINTF_ALLOC_H
-int sprintf_alloc(char **str, const char *fmt, ...);
+void sprintf_alloc(char **str, const char *fmt, ...);
#endif