summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-12 00:51:57 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-12 00:51:57 +0000
commitfac41f0f15d55fae67d6a1a149585c1682cc9bf9 (patch)
treea6dea6eefaf53e6b45eba0b82eb46d5f59154f05 /chrome
parent1f632c12ff697553edd95f1f99755b692be7b2ff (diff)
downloadchromium_src-fac41f0f15d55fae67d6a1a149585c1682cc9bf9.zip
chromium_src-fac41f0f15d55fae67d6a1a149585c1682cc9bf9.tar.gz
chromium_src-fac41f0f15d55fae67d6a1a149585c1682cc9bf9.tar.bz2
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
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/gtk/gtk_chrome_link_button.cc11
1 files changed, 5 insertions, 6 deletions
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<gchar*>(
- 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<gchar*>(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