From 6027c94a438549a1a20b98004f145b2362d307a5 Mon Sep 17 00:00:00 2001 From: Eric House Date: Fri, 21 Jun 2013 07:26:11 -0700 Subject: [PATCH] don't pass uninitialized variables to logf --- xwords4/relay/dbmgr.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/xwords4/relay/dbmgr.cpp b/xwords4/relay/dbmgr.cpp index e205484ec..c08622dfd 100644 --- a/xwords4/relay/dbmgr.cpp +++ b/xwords4/relay/dbmgr.cpp @@ -674,8 +674,15 @@ DBMgr::TokenFor( const char* const connName, int hid, DevIDRelay* devid, } } PQclear( result ); - logf( XW_LOGINFO, "%s(%s,%d)=>%s (%d, %d)", __func__, connName, hid, - (found?"true":"false"), *devid, *token ); + + + if ( found ) { + logf( XW_LOGINFO, "%s(%s,%d)=>true (%d, %d)", __func__, connName, hid, + *devid, *token ); + } else { + logf( XW_LOGINFO, "%s(%s,%d)=>false", __func__, connName, hid ); + } + return found; }