[Aptitude-svn-commit] r3776 - in branches/aptitude-0.3/aptitude: . src

Daniel Burrows dburrows at costa.debian.org
Tue Aug 9 01:30:52 UTC 2005


Author: dburrows
Date: Tue Aug  9 01:30:48 2005
New Revision: 3776

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/src/ui.cc
Log:
Eliminate local s*printfs.

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Tue Aug  9 01:30:48 2005
@@ -1,5 +1,9 @@
 2005-08-08  Daniel Burrows  <dburrows at debian.org>
 
+	* src/ui.cc:
+
+	  Use sw?sprintf rather than a local w?snprintf in several spots.
+
 	* src/vscreen/vs_util.cc:
 
 	  Change an implementation signature of vs_dialog_fileview to

Modified: branches/aptitude-0.3/aptitude/src/ui.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/ui.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/ui.cc	Tue Aug  9 01:30:48 2005
@@ -80,6 +80,7 @@
 #include <generic/apt_undo_group.h>
 #include <generic/aptitude_resolver.h>
 #include <generic/config_signal.h>
+#include <generic/util.h>
 
 #include "dep_item.h"
 #include "download.h"
@@ -1227,11 +1228,8 @@
 
       msg->destroy();
 
-      char buf[512];
-
-      snprintf(buf, 512, _("Obsolete downloaded package files have been deleted, freeing %sB of disk space."),
-	       SizeToStr(cleaned_size).c_str());
-      show_message(buf);
+      show_message(ssprintf(_("Obsolete downloaded package files have been deleted, freeing %sB of disk space."),
+			    SizeToStr(cleaned_size).c_str()));
     }
 }
 
@@ -1796,15 +1794,14 @@
     update_key=global_bindings.readable_keyname("UpdatePackageList"),
     install_key=global_bindings.readable_keyname("DoInstallRun");
 
-  wchar_t buf[512];
-  swprintf(buf, 512, transcode(_("%ls: Menu  %ls: Help  %ls: Quit  %ls: Update  %ls: Download/Install/Remove Pkgs")).c_str(),
-	   menu_key.c_str(),
-	   help_key.c_str(),
-	   quit_key.c_str(),
-	   update_key.c_str(),
-	   install_key.c_str());
+  wstring helptext = swsprintf(transcode(_("%ls: Menu  %ls: Help  %ls: Quit  %ls: Update  %ls: Download/Install/Remove Pkgs")).c_str(),
+			menu_key.c_str(),
+			help_key.c_str(),
+			quit_key.c_str(),
+			update_key.c_str(),
+			install_key.c_str());
 
-  help_bar *help_label=new help_bar(buf, get_style("Header"));
+  help_bar *help_label=new help_bar(helptext, get_style("Header"));
   main_table->add_widget_opts(help_label, 0, 0, 1, 1,
 			      vs_table::EXPAND | vs_table::FILL | vs_table::SHRINK,
 			      vs_table::ALIGN_CENTER);



More information about the Aptitude-svn-commit mailing list