[Haiku-commits] r27914 - haiku/trunk/src/bin

julun at BerliOS julun at mail.berlios.de
Tue Oct 7 23:47:47 CEST 2008


Author: julun
Date: 2008-10-07 23:47:46 +0200 (Tue, 07 Oct 2008)
New Revision: 27914
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=27914&view=rev

Modified:
   haiku/trunk/src/bin/hey.cpp
Log:
* The size of the array passed should was not enough to hold the entire formatted string.
  This fixes ticket #2802. (Not sure why it only happend on gcc4)



Modified: haiku/trunk/src/bin/hey.cpp
===================================================================
--- haiku/trunk/src/bin/hey.cpp	2008-10-07 21:40:39 UTC (rev 27913)
+++ haiku/trunk/src/bin/hey.cpp	2008-10-07 21:47:46 UTC (rev 27914)
@@ -1338,7 +1338,7 @@
 							}
 							for (int32 i = 0; i < 10 && pinfo[pinfo_index].types[i] != 0; i++) {
 								uint32 type = pinfo[pinfo_index].types[i];
-								char str2[4];
+								char str2[6];
 								sprintf(str2, "%c%c%c%c ", int(type & 0xFF000000) >> 24,
 									int(type & 0xFF0000) >> 16, int(type & 0xFF00) >> 8, (int)type & 0xFF);
 								strcat(str, str2);
@@ -1347,7 +1347,7 @@
 							for (int32 i = 0; i < 3; i++) {
 								for (int32 j = 0; j < 5 && pinfo[pinfo_index].ctypes[i].pairs[j].type != 0; j++) {
 									uint32 type = pinfo[pinfo_index].ctypes[i].pairs[j].type;
-									char str2[4];
+									char str2[strlen(pinfo[pinfo_index].ctypes[i].pairs[j].name) + 8];
 									sprintf(str2, "(%s %c%c%c%c)", pinfo[pinfo_index].ctypes[i].pairs[j].name,
 										int(type & 0xFF000000) >> 24,
 										int(type & 0xFF0000) >> 16,




More information about the Haiku-commits mailing list