summaryrefslogtreecommitdiff
path: root/json.c
diff options
context:
space:
mode:
authorJon Schlueter <jschlueter@redhat.com>2015-10-06 04:29:37 -0400
committerJon Schlueter <jschlueter@redhat.com>2015-10-06 04:31:59 -0400
commitc9d7ff1be596a0cea5cea35156d8ee6ff44080ac (patch)
treee101cc4adde017cedea8f57249fe059f48679829 /json.c
parent5c20d030c70578d6d212b00cc972e2b19d5abf9c (diff)
downloadgpsd-c9d7ff1be596a0cea5cea35156d8ee6ff44080ac.tar.gz
json_trace improvement
guard on FILE * not being NULL initialize the buffer for easier debugging
Diffstat (limited to 'json.c')
-rw-r--r--json.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/json.c b/json.c
index 182a018b..ca192856 100644
--- a/json.c
+++ b/json.c
@@ -93,8 +93,8 @@ void json_enable_debug(int level, FILE * fp)
static void json_trace(int errlevel, const char *fmt, ...)
/* assemble command in printf(3) style */
{
- if (errlevel <= debuglevel) {
- char buf[BUFSIZ];
+ if (errlevel <= debuglevel && NULL != debugfp) {
+ char buf[BUFSIZ] = {0};
va_list ap;
(void)strlcpy(buf, "json: ", sizeof(buf));