tool/CommandFoeWrite.cpp
changeset 2066 b544025bd696
parent 2004 be807e224b0e
child 2589 2b9c78543663
--- a/tool/CommandFoeWrite.cpp	Thu May 12 16:38:48 2011 +0200
+++ b/tool/CommandFoeWrite.cpp	Thu May 12 16:45:02 2011 +0200
@@ -140,7 +140,8 @@
 
     // write data via foe to the slave
     data.offset = 0;
-    strncpy(data.file_name, storeFileName.c_str(), sizeof(data.file_name));
+    strncpy(data.file_name, storeFileName.c_str(), sizeof(data.file_name)-1);
+    data.file_name[sizeof(data.file_name)-1] = '\0';
 
     try {
         m.writeFoe(&data);