summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-09-14 19:12:39 +0200
committerStefan Metzmacher <metze@samba.org>2008-09-14 19:12:39 +0200
commit375ca336fecbe33b132fd1abb8df9b7af44ede76 (patch)
tree3a3b664ebf7b4a23aaa33d426dd5560084716402
parent79297bc1326a6231ea465a6344717d525595cc22 (diff)
downloadsamba-375ca336fecbe33b132fd1abb8df9b7af44ede76.tar.gz
samba-375ca336fecbe33b132fd1abb8df9b7af44ede76.tar.bz2
samba-375ca336fecbe33b132fd1abb8df9b7af44ede76.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. (partialy cherry picked from commit 5b3a8c8ae195e6a98357a407a0699493f54a8b79) metze (This used to be commit 0073e41a0157ec43b944372671299b3e8a2b3cd5)
-rw-r--r--source3/lib/talloc/talloc.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source3/lib/talloc/talloc.c b/source3/lib/talloc/talloc.c
index 99210f3e1b..5691a81a9a 100644
--- a/source3/lib/talloc/talloc.c
+++ b/source3/lib/talloc/talloc.c
@@ -1436,13 +1436,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);
@@ -1467,6 +1469,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;