From e82589a5267fff9b4abb2223545a3c717f2d4648 Mon Sep 17 00:00:00 2001 From: Eric House Date: Sat, 8 Nov 2014 23:07:34 -0800 Subject: [PATCH 1/2] replace overloaded method with diff-named one, avoiding call to wrong one when compiled on old 32-bit Atom. 32-bit issue, or what? This is quick and sure to fix it. Should be grafted back to main branch. --- xwords4/relay/querybld.cpp | 2 +- xwords4/relay/strwpf.cpp | 4 ++-- xwords4/relay/strwpf.h | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/xwords4/relay/querybld.cpp b/xwords4/relay/querybld.cpp index 6334d1f9f..4caa04dde 100644 --- a/xwords4/relay/querybld.cpp +++ b/xwords4/relay/querybld.cpp @@ -28,7 +28,7 @@ QueryBuilder::appendQueryf( const char* fmt, ... ) do { va_list ap; va_start( ap, fmt ); - done = m_query.catf( fmt, ap ); + done = m_query.catfap( fmt, ap ); va_end( ap ); } while ( !done ); return *this; diff --git a/xwords4/relay/strwpf.cpp b/xwords4/relay/strwpf.cpp index d6085755a..823b80a6e 100644 --- a/xwords4/relay/strwpf.cpp +++ b/xwords4/relay/strwpf.cpp @@ -28,7 +28,7 @@ */ bool -StrWPF::catf( const char* fmt, va_list ap ) +StrWPF::catfap( const char* fmt, va_list ap ) { bool success = false; const int origsiz = size(); @@ -57,7 +57,7 @@ StrWPF::catf( const char* fmt, ... ) do { va_list ap; va_start( ap, fmt ); - done = catf( fmt, ap ); + done = catfap( fmt, ap ); va_end( ap ); } while ( !done ); } diff --git a/xwords4/relay/strwpf.h b/xwords4/relay/strwpf.h index e3973d2dc..c1d82a88d 100644 --- a/xwords4/relay/strwpf.h +++ b/xwords4/relay/strwpf.h @@ -28,7 +28,9 @@ class StrWPF : public std::string { StrWPF() : m_addsiz(100){} void catf( const char* fmt, ... ); - bool catf( const char* fmt, va_list ap ); + /* Don't overload catf: some compilers use the wrong one, maybe on + 32-bit? */ + bool catfap( const char* fmt, va_list ap ); private: int m_addsiz; }; From 4b635791d77c93bf08a32ab10e2af33315e4740c Mon Sep 17 00:00:00 2001 From: Eric House Date: Sat, 22 Nov 2014 17:08:17 -0800 Subject: [PATCH 2/2] crash fix: provide missing param to format string --- xwords4/relay/xwrelay.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xwords4/relay/xwrelay.cpp b/xwords4/relay/xwrelay.cpp index 268cbef3f..07c6f09ea 100644 --- a/xwords4/relay/xwrelay.cpp +++ b/xwords4/relay/xwrelay.cpp @@ -1690,7 +1690,8 @@ handle_udp_packet( UdpThreadClosure* utc ) AddrInfo addr( g_udpsock, clientToken, utc->saddr() ); (void)processMessage( ptr, end - ptr, &addr ); } else { - logf( XW_LOGERROR, "%s: dropping packet with token of 0" ); + logf( XW_LOGERROR, "%s: dropping packet with token of 0", + __func__ ); } break; }