From fac41f0f15d55fae67d6a1a149585c1682cc9bf9 Mon Sep 17 00:00:00 2001 From: "estade@chromium.org" Date: Thu, 12 Nov 2009 00:51:57 +0000 Subject: Compile fix for linux. TBR=erikkay Review URL: http://codereview.chromium.org/386011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31746 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/gtk/gtk_chrome_link_button.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'chrome') diff --git a/chrome/browser/gtk/gtk_chrome_link_button.cc b/chrome/browser/gtk/gtk_chrome_link_button.cc index 764c9c7..845e0dc 100644 --- a/chrome/browser/gtk/gtk_chrome_link_button.cc +++ b/chrome/browser/gtk/gtk_chrome_link_button.cc @@ -70,18 +70,17 @@ static void gtk_chrome_link_button_set_text(GtkChromeLinkButton* button) { if (native_color) { gchar color_spec[9]; - sprintf(color_spec, 9, "#%02X%02X%02X", native_color->red / 257, - native_color->green / 257, native_color->blue / 257); + snprintf(color_spec, 9, "#%02X%02X%02X", native_color->red / 257, + native_color->green / 257, native_color->blue / 257); gdk_color_free(native_color); if (!uses_markup) { button->native_markup = g_markup_printf_escaped(kLinkMarkup, color_spec, text); } else { - button->native_markup = static_cast( - g_malloc(strlen(kLinkMarkup) + strlen(color_spec) + strlen(text) + - 1)); - sprintf(button->native_markup, kLinkMarkup, color_spec, text); + int length = strlen(kLinkMarkup) + strlen(color_spec) + strlen(text) + 1; + button->native_markup = static_cast(g_malloc(length)); + snprintf(button->native_markup, length, kLinkMarkup, color_spec, text); } } else { // If the theme doesn't have a link color, just use blue. This matches the -- cgit v1.1