tool/CommandFoeWrite.cpp
changeset 1869 14f634f5b613
parent 1826 ec6223c3b7ec
child 1870 0cee1fb7f0fd
--- a/tool/CommandFoeWrite.cpp	Thu Mar 11 14:29:43 2010 +0100
+++ b/tool/CommandFoeWrite.cpp	Thu Mar 11 15:03:52 2010 +0100
@@ -82,6 +82,7 @@
 
 void CommandFoeWrite::execute(const StringVector &args)
 {
+	MasterIndexList masterIndices;
     stringstream err;
     ec_ioctl_slave_foe_t data;
     ifstream file;
@@ -93,11 +94,12 @@
         throwInvalidUsageException(err);
     }
 
-    if (getMasterIndices().size() != 1) {
+	masterIndices = getMasterIndices();
+    if (masterIndices.size() != 1) {
         err << getName() << " requires to select a single master!";
         throwInvalidUsageException(err);
     }
-    MasterDevice m(getMasterIndices().front());
+    MasterDevice m(masterIndices.front());
 
     if (args[0] == "-") {
         loadFoeData(&data, cin);