aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd/main.c
diff options
context:
space:
mode:
authorSrinivas Girigowda <sgirigow@qca.qualcomm.com>2014-08-28 15:25:32 (GMT)
committerJouni Malinen <j@w1.fi>2014-08-28 15:25:32 (GMT)
commitdb9418bb1b8054b54d9b299e0334850d5e2b77ad (patch)
tree4188744735f54436cccd36e1914ea3117236614e /hostapd/main.c
parentd6df0d7e621904d46e197725aea83d129fa397ac (diff)
downloadhostap-db9418bb1b8054b54d9b299e0334850d5e2b77ad.zip
hostap-db9418bb1b8054b54d9b299e0334850d5e2b77ad.tar.gz
hostap-db9418bb1b8054b54d9b299e0334850d5e2b77ad.tar.bz2
Add printf NULL checks to silence static analyzer
Add NULL checks to take care of issues reported by static analyzer tool on potentially using NULL with printf format %s (which has undefined behavior even though many compilers end up printing "(null)"). Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'hostapd/main.c')
-rw-r--r--hostapd/main.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/hostapd/main.c b/hostapd/main.c
index a9d7da5..a9d91b9 100644
--- a/hostapd/main.c
+++ b/hostapd/main.c
@@ -97,14 +97,15 @@ static void hostapd_logger_cb(void *ctx, const u8 *addr, unsigned int module,
else if (hapd && hapd->conf)
os_snprintf(format, maxlen, "%s:%s%s %s",
hapd->conf->iface, module_str ? " " : "",
- module_str, txt);
+ module_str ? module_str : "", txt);
else if (addr)
os_snprintf(format, maxlen, "STA " MACSTR "%s%s: %s",
MAC2STR(addr), module_str ? " " : "",
- module_str, txt);
+ module_str ? module_str : "", txt);
else
os_snprintf(format, maxlen, "%s%s%s",
- module_str, module_str ? ": " : "", txt);
+ module_str ? module_str : "",
+ module_str ? ": " : "", txt);
if ((conf_stdout & module) && level >= conf_stdout_level) {
wpa_debug_print_timestamp();