From 146c2e006ef5974ea952ce96eba0109c182db237 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 15 Jul 2014 15:58:03 +0200 Subject: [PATCH] crashrep: loplugin:unreffun Change-Id: I83d4c3ee02e59d40e793288d705c3fd06ebe3219 --- crashrep/source/unx/main.cxx | 68 ------------------------------------ 1 file changed, 68 deletions(-) diff --git a/crashrep/source/unx/main.cxx b/crashrep/source/unx/main.cxx index a49ef7e7ff51..65d70e2cdf22 100644 --- a/crashrep/source/unx/main.cxx +++ b/crashrep/source/unx/main.cxx @@ -258,35 +258,6 @@ static void printSettings( const boost::unordered_map& rSettings } #endif -bool save_crash_report( const string& rFileName, const boost::unordered_map< string, string >& /*rSettings*/ ) -{ - bool bSuccess = false; - FILE *fpout = fopen( rFileName.c_str(), "w" ); - - if ( fpout ) - { - FILE *fpin = fopen( g_szStackFile, "r" ); - - if ( fpin ) - { - char buf[1024]; - - while (fgets(buf, sizeof(buf), fpin) != NULL) - { - fputs(buf, fpout); - } - - bSuccess = true; - - fclose ( fpin ); - } - - fclose( fpout ); - } - - return bSuccess; -} - bool SendHTTPRequest( FILE *fp, const char *pszServer, @@ -516,45 +487,6 @@ bool send_crash_report( const boost::unordered_map< string, string >& rSettings } -static bool append_file( const char *filename, string& rString ) -{ - FILE *fp = fopen( filename, "r" ); - if ( fp ) - { - char buf[1024]; - while (fgets(buf, sizeof(buf), fp) != NULL) - { - rString.append( buf ); - } - fclose( fp ); - return true; - } - - return false; -} - -string crash_get_details( const boost::unordered_map< string, string >& rSettings ) -{ - string aRet; - - write_description( rSettings ); - write_report( rSettings ); - - aRet.append( rSettings.find( "TITLE" )->second.c_str() ); - aRet.append( "\n\n" ); - append_file( g_szDescriptionFile, aRet ); - aRet.append( "\n\n-------\n\n" ); - append_file( g_szReportFile, aRet ); - aRet.append( "\n\n-------\n\n" ); - append_file( g_szStackFile, aRet ); - - unlink( g_szDescriptionFile ); - unlink( g_szReportFile ); - - return aRet; -} - - // ensure validity of program relative paths static void setup_program_dir( const char* progname ) {