summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorMartin Pool <mbp@samba.org>2001-12-19 05:02:42 +0000
committerMartin Pool <mbp@samba.org>2001-12-19 05:02:42 +0000
commitd3abe277ef90534b984ae5d250e4533017e77275 (patch)
treefdc074d1af99b5a3fc98d903716f995c26d0be22 /source3
parent55f6eefe12d4864724fc4cb0584ef1426e27ff7b (diff)
downloadsamba-d3abe277ef90534b984ae5d250e4533017e77275.tar.gz
samba-d3abe277ef90534b984ae5d250e4533017e77275.tar.bz2
samba-d3abe277ef90534b984ae5d250e4533017e77275.zip
Put PRINTF_ATTRIBUTE on talloc_init_named, talloc_asprintf,
talloc_vasprintf. (This used to be commit e6be48671d520f952be0b6dc0848569d0d834179)
Diffstat (limited to 'source3')
-rw-r--r--source3/include/talloc.h8
-rw-r--r--source3/lib/talloc.c6
2 files changed, 11 insertions, 3 deletions
diff --git a/source3/include/talloc.h b/source3/include/talloc.h
index 8e20cc028a..fb2fb6a0c3 100644
--- a/source3/include/talloc.h
+++ b/source3/include/talloc.h
@@ -42,4 +42,12 @@ typedef struct {
char *name;
} TALLOC_CTX;
+TALLOC_CTX *talloc_init_named(char const *fmt, ...) PRINTF_ATTRIBUTE(1, 2);
+
+char *talloc_vasprintf(TALLOC_CTX *t, const char *fmt, va_list ap)
+ PRINTF_ATTRIBUTE(2, 0);
+
+char *talloc_asprintf(TALLOC_CTX *t, const char *fmt, ...)
+ PRINTF_ATTRIBUTE(2, 3);
+
#endif
diff --git a/source3/lib/talloc.c b/source3/lib/talloc.c
index ff1bdd0000..45f9ed8004 100644
--- a/source3/lib/talloc.c
+++ b/source3/lib/talloc.c
@@ -62,7 +62,7 @@ TALLOC_CTX *talloc_init(void)
* Create a new talloc context, with a name specifying its purpose.
* Please call this in preference to talloc_init().
**/
-TALLOC_CTX *talloc_init_named(char const *fmt, ...)
+ TALLOC_CTX *talloc_init_named(char const *fmt, ...)
{
TALLOC_CTX *t;
va_list ap;
@@ -197,7 +197,7 @@ char *talloc_strdup(TALLOC_CTX *t, const char *p)
* Perform string formatting, and return a pointer to newly allocated
* memory holding the result, inside a memory pool.
**/
-char *talloc_asprintf(TALLOC_CTX *t, const char *fmt, ...)
+ char *talloc_asprintf(TALLOC_CTX *t, const char *fmt, ...)
{
va_list ap;
char *ret;
@@ -210,7 +210,7 @@ char *talloc_asprintf(TALLOC_CTX *t, const char *fmt, ...)
}
-char *talloc_vasprintf(TALLOC_CTX *t, const char *fmt, va_list ap)
+ char *talloc_vasprintf(TALLOC_CTX *t, const char *fmt, va_list ap)
{
int len;
char *ret;