summaryrefslogtreecommitdiff
path: root/source4/lib/talloc
diff options
context:
space:
mode:
authorKai Blin <kai@samba.org>2007-12-17 18:31:16 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:51:17 +0100
commitac4237e9971bd50ef194f2166365ff91af4dbfaa (patch)
tree13c69a409f1e327f3625e4d1eb981a5e1943c0d0 /source4/lib/talloc
parent93378b9893235596f2c88144e17a5809fefe5bc7 (diff)
downloadsamba-ac4237e9971bd50ef194f2166365ff91af4dbfaa.tar.gz
samba-ac4237e9971bd50ef194f2166365ff91af4dbfaa.tar.bz2
samba-ac4237e9971bd50ef194f2166365ff91af4dbfaa.zip
r26511: Janitorial: Fix a warning for the 'printf' attribute on gendb_search_v
While at it, also add a PRINTF_ATTRIBUTE for talloc_vasprintf. (This used to be commit 5b3a8c8ae195e6a98357a407a0699493f54a8b79)
Diffstat (limited to 'source4/lib/talloc')
-rw-r--r--source4/lib/talloc/talloc.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source4/lib/talloc/talloc.c b/source4/lib/talloc/talloc.c
index 4d72c0e871..6661c10bb5 100644
--- a/source4/lib/talloc/talloc.c
+++ b/source4/lib/talloc/talloc.c
@@ -1245,13 +1245,15 @@ char *talloc_strndup_append_buffer(char *s, const char *a, size_t n)
#endif
#endif
+char *talloc_vasprintf(const void *t, const char *fmt, va_list ap) PRINTF_ATTRIBUTE(2,0);
+
char *talloc_vasprintf(const void *t, const char *fmt, va_list ap)
-{
+{
int len;
char *ret;
va_list ap2;
char c;
-
+
/* this call looks strange, but it makes it work on older solaris boxes */
va_copy(ap2, ap);
len = vsnprintf(&c, 1, fmt, ap2);
@@ -1276,6 +1278,7 @@ char *talloc_vasprintf(const void *t, const char *fmt, va_list ap)
Perform string formatting, and return a pointer to newly allocated
memory holding the result, inside a memory pool.
*/
+char *talloc_asprintf(const void *t, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3);
char *talloc_asprintf(const void *t, const char *fmt, ...)
{
va_list ap;