return error when part or name was defined and part is last item

This commit is contained in:
john30
2014-12-31 10:47:22 +01:00
parent 3b13791c4d
commit a865dfe322
+5 -3
View File
@@ -170,10 +170,12 @@ result_t DataField::create(vector<string>::iterator& it,
partType = pt_any;
else {
const char* partStr = (*it++).c_str();
if (it == end)
break;
hasPartStr = partStr[0] != 0;
if (it == end) {
if (name.empty() == false || hasPartStr == true)
result = RESULT_ERR_MISSING_TYPE;
break;
}
if (dstAddress == BROADCAST || isMaster(dstAddress) == true
|| (isWriteMessage == true && hasPartStr == false)
|| strcasecmp(partStr, "M") == 0) { // master data