tool/CommandFoeWrite.cpp
changeset 1991 15d656ef81af
parent 1870 0cee1fb7f0fd
child 2004 be807e224b0e
--- a/tool/CommandFoeWrite.cpp	Wed May 12 15:07:13 2010 +0200
+++ b/tool/CommandFoeWrite.cpp	Wed Jul 07 14:24:35 2010 +0200
@@ -139,7 +139,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);