[SSSD] [PATCH] Fix warning zero-length gnu_printf format string

Lukas Slebodnik lslebodn at redhat.com
Wed Feb 12 19:57:01 UTC 2014


ehlo,

I found a warning "zero-length gnu_printf format string" when I was testing
patches on ALT linux. It is in the ifdef section if nsupdate do not have
support for realm.

Simple patch attached.

LS
-------------- next part --------------
>From 994eefffa19006a3b39bbc5cd2b3704c5d88f903 Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lslebodn at redhat.com>
Date: Tue, 11 Feb 2014 20:08:31 -0500
Subject: [PATCH] Fix warning zero-length gnu_printf format string

There is a warning if nsupdate does not support realm.
warning: zero-length gnu_printf format string [-Wformat-zero-length]
---
 src/providers/dp_dyndns.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/providers/dp_dyndns.c b/src/providers/dp_dyndns.c
index fb789ee18fa1d50f7f98cc1a4eedd0a53756f07d..0abf19a425c927d4092accda9cedbc61df35fbe3 100644
--- a/src/providers/dp_dyndns.c
+++ b/src/providers/dp_dyndns.c
@@ -389,7 +389,7 @@ nsupdate_msg_create_common(TALLOC_CTX *mem_ctx, const char *realm,
 #ifdef HAVE_NSUPDATE_REALM
     realm_directive = talloc_asprintf(tmp_ctx, "realm %s\n", realm);
 #else
-    realm_directive = talloc_asprintf(tmp_ctx, "");
+    realm_directive = talloc_asprintf(tmp_ctx, "\n");
 #endif
     if (!realm_directive) {
         goto fail;
-- 
1.8.5.3



More information about the sssd-devel mailing list