--- a/tool/CommandDownload.cpp Thu Mar 11 14:29:43 2010 +0100
+++ b/tool/CommandDownload.cpp Thu Mar 11 15:03:52 2010 +0100
@@ -85,6 +85,7 @@
void CommandDownload::execute(const StringVector &args)
{
stringstream strIndex, strSubIndex, err;
+ MasterIndexList masterIndices;
ec_ioctl_slave_sdo_download_t data;
unsigned int number;
const DataType *dataType = NULL;
@@ -114,11 +115,12 @@
}
data.sdo_entry_subindex = number;
- 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());
m.open(MasterDevice::ReadWrite);
slaves = selectedSlaves(m);
if (slaves.size() != 1) {