--- a/tool/CommandRegWrite.cpp Thu Mar 11 14:29:43 2010 +0100
+++ b/tool/CommandRegWrite.cpp Thu Mar 11 15:03:52 2010 +0100
@@ -81,6 +81,7 @@
void CommandRegWrite::execute(const StringVector &args)
{
+ MasterIndexList masterIndices;
stringstream strOffset, err;
ec_ioctl_slave_reg_t data;
ifstream file;
@@ -100,11 +101,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 (getDataType().empty()) {
if (args[1] == "-") {