bintools/rcomp/src/main.cpp
changeset 626 ac03b93ca9c4
parent 590 360bd6b35136
--- a/bintools/rcomp/src/main.cpp	Thu Aug 12 09:00:16 2010 +0100
+++ b/bintools/rcomp/src/main.cpp	Tue Aug 17 15:31:16 2010 +0800
@@ -576,9 +576,10 @@
 			MOFF; cout << uidcrcTool << " " << uidcrcUIDs[0] << " " << uidcrcUIDs[1] << " " << uidcrcUIDs[2] << " " << DataOutputFileName.GetAssertedNonEmptyBuffer(); cout << endl; MON;
 			}
 
-		char uidcrc_params[512];
+		int namelen = strlen(uidcrcTool) + strlen(uidcrcUIDs[0]) * 3 + DataOutputFileName.Length() + 10; 
+		char *uidcrc_params = new char[namelen];
 		const int ret = snprintf(uidcrc_params,
-					 sizeof(uidcrc_params),
+					 namelen,
 					 "%s %s %s %s %s",
 					 uidcrcTool,
 					 uidcrcUIDs[0],
@@ -596,6 +597,8 @@
 			cerr << "Failed to write UIDs to " << DataOutputFileName << endl;
 			exit(error);
 			}
+		delete[] uidcrc_params;
+
 		RCBinaryStream RSCStream;
 		RSCStream.OpenForAppend(DataOutputFileName);
 		if(! RSCStream.IsOpen())