r26511: Janitorial: Fix a warning for the 'printf' attribute on gendb_search_v
authorKai Blin <kai@samba.org>
Mon, 17 Dec 2007 17:31:16 +0000 (18:31 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 21 Dec 2007 04:51:17 +0000 (05:51 +0100)
While at it, also add a PRINTF_ATTRIBUTE for talloc_vasprintf.

source/lib/talloc/talloc.c
source/lib/util/util_ldb.c

index 4d72c0e871a2d190d37a5021aaa40e3e629250bd..6661c10bb53c46f0fefdab495bcd138a70f7a1d1 100644 (file)
@@ -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;
index ba8443c23642fc576ea16db5dba1593e5e10cb21..a8719af19007885fe712513d5ed870e15795b97a 100644 (file)
 #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;