From 3db42f84371cf7ae9c1ec6cbf3668424645c7479 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Tue, 10 Mar 2015 01:43:08 +0100 Subject: optimized Interface::info_update() implementations * use g_strconcat() instead of g_strdup_printf() * InterfaceGtk::info_update() now longer has an arbitrary 255 byte limit on the length of the info line. --- src/interface-curses.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/interface-curses.cpp') diff --git a/src/interface-curses.cpp b/src/interface-curses.cpp index a9bb466..7a242cd 100644 --- a/src/interface-curses.cpp +++ b/src/interface-curses.cpp @@ -245,8 +245,8 @@ InterfaceCurses::info_update_impl(const QRegister *reg) gchar *name = String::canonicalize_ctl(reg->name); g_free(info_current); - info_current = g_strdup_printf("%s - %s", - PACKAGE_NAME, name); + info_current = g_strconcat(PACKAGE_NAME " - ", + name, NIL); g_free(name); draw_info(); @@ -256,9 +256,9 @@ void InterfaceCurses::info_update_impl(const Buffer *buffer) { g_free(info_current); - info_current = g_strdup_printf("%s - %s%s", PACKAGE_NAME, - buffer->filename ? : UNNAMED_FILE, - buffer->dirty ? "*" : ""); + info_current = g_strconcat(PACKAGE_NAME " - ", + buffer->filename ? : UNNAMED_FILE, + buffer->dirty ? "*" : "", NIL); draw_info(); } -- cgit v1.2.3