svn commit: samba r26511 - in branches/SAMBA_4_0/source/lib: talloc
util
kai at samba.org
kai at samba.org
Mon Dec 17 18:31:17 GMT 2007
Author: kai
Date: 2007-12-17 18:31:16 +0000 (Mon, 17 Dec 2007)
New Revision: 26511
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=26511
Log:
Janitorial: Fix a warning for the 'printf' attribute on gendb_search_v
While at it, also add a PRINTF_ATTRIBUTE for talloc_vasprintf.
Modified:
branches/SAMBA_4_0/source/lib/talloc/talloc.c
branches/SAMBA_4_0/source/lib/util/util_ldb.c
Changeset:
Modified: branches/SAMBA_4_0/source/lib/talloc/talloc.c
===================================================================
--- branches/SAMBA_4_0/source/lib/talloc/talloc.c 2007-12-17 17:40:57 UTC (rev 26510)
+++ branches/SAMBA_4_0/source/lib/talloc/talloc.c 2007-12-17 18:31:16 UTC (rev 26511)
@@ -1245,13 +1245,15 @@
#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 @@
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;
Modified: branches/SAMBA_4_0/source/lib/util/util_ldb.c
===================================================================
--- branches/SAMBA_4_0/source/lib/util/util_ldb.c 2007-12-17 17:40:57 UTC (rev 26510)
+++ branches/SAMBA_4_0/source/lib/util/util_ldb.c 2007-12-17 18:31:16 UTC (rev 26511)
@@ -23,16 +23,16 @@
#include "includes.h"
#include "lib/ldb/include/ldb.h"
#include "lib/ldb/include/ldb_errors.h"
-
+#include "lib/util/util_ldb.h"
/*
search the sam for the specified attributes - va_list variant
*/
-int gendb_search_v(struct ldb_context *ldb,
+int gendb_search_v(struct ldb_context *ldb,
TALLOC_CTX *mem_ctx,
struct ldb_dn *basedn,
struct ldb_message ***msgs,
const char * const *attrs,
- const char *format,
+ const char *format,
va_list ap) _PRINTF_ATTRIBUTE(6,0)
{
enum ldb_scope scope = LDB_SCOPE_SUBTREE;
More information about the samba-cvs
mailing list