diff --git a/xwords4/relay/ctrl.cpp b/xwords4/relay/ctrl.cpp index 31f598b2e..460ebe279 100644 --- a/xwords4/relay/ctrl.cpp +++ b/xwords4/relay/ctrl.cpp @@ -360,7 +360,7 @@ format_uptime( char* buf, int len ) seconds %= 60; snprintf( buf, len, - "uptime: %d days, %d hours, %d minutes, %ld seconds", + "uptime: %d D, %d H, %d M, %ld S", days, hours, minutes, seconds ); } diff --git a/xwords4/relay/http.cpp b/xwords4/relay/http.cpp index 6214ba8c5..7c546b5e2 100644 --- a/xwords4/relay/http.cpp +++ b/xwords4/relay/http.cpp @@ -95,16 +95,6 @@ send_meta( FILE* fil ) fprintf( fil, "" ); } -static void -printUptime( FILE* fil ) -{ - char buf[128]; - - fprintf( fil, "
Uptime
" ); - format_uptime( buf, sizeof(buf) ); - fprintf( fil, "

%s

", buf ); -} - static void printTail( FILE* fil ) { @@ -163,10 +153,14 @@ printStats( FILE* fil ) CRefMgr* cmgr = CRefMgr::Get(); int nGames = cmgr->GetNumGamesSeen(); int siz = cmgr->GetSize(); + char uptime[64]; + format_uptime( uptime, sizeof(uptime) ); fprintf( fil, "
Stats
" ); fprintf( fil, "" ); - fprintf( fil, "" ); - fprintf( fil, "\n", nGames, siz ); + fprintf( fil, "" + "" ); + fprintf( fil, "\n", + nGames, siz, uptime ); fprintf( fil, "
Games playedGames in play
%d%d
Games playedGames in playUptime
%d%d%s
" ); } @@ -200,8 +194,6 @@ http_thread_main( void* arg ) printCrefs( fil ); - printUptime( fil ); - printTail( fil ); fprintf( fil, "" );