[haiku-commits] r37840 - haiku/trunk/src/apps/icon-o-matic/generic/support

  • From: superstippi@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 2 Aug 2010 14:26:19 +0200 (CEST)

Author: stippi
Date: 2010-08-02 14:26:19 +0200 (Mon, 02 Aug 2010)
New Revision: 37840
Changeset: http://dev.haiku-os.org/changeset/37840

Modified:
   haiku/trunk/src/apps/icon-o-matic/generic/support/support_ui.cpp
Log:
Fixed stack corruption.


Modified: haiku/trunk/src/apps/icon-o-matic/generic/support/support_ui.cpp
===================================================================
--- haiku/trunk/src/apps/icon-o-matic/generic/support/support_ui.cpp    
2010-08-02 11:47:12 UTC (rev 37839)
+++ haiku/trunk/src/apps/icon-o-matic/generic/support/support_ui.cpp    
2010-08-02 12:26:19 UTC (rev 37840)
@@ -74,9 +74,10 @@
 {
        // prepare message
        BMessage message(B_PASTE);
-       char hexstr[7];
-       sprintf(hexstr, "#%.2X%.2X%.2X", color.red, color.green, color.blue);
-       message.AddData("text/plain", B_MIME_TYPE, &hexstr, sizeof(hexstr));
+       char hexString[8];
+       snprintf(hexString, sizeof(hexString), "#%.2X%.2X%.2X",
+               color.red, color.green, color.blue);
+       message.AddData("text/plain", B_MIME_TYPE, &hexString, 
sizeof(hexString));
        message.AddData("RGBColor", B_RGB_COLOR_TYPE, &color, sizeof(color));
        // prepare bitmap
        if (bitmap && bitmap->IsValid()


Other related posts:

  • » [haiku-commits] r37840 - haiku/trunk/src/apps/icon-o-matic/generic/support - superstippi