Skip to content

Commit

Permalink
Merge pull request #30 from qualisys/fix_command_response_check
Browse files Browse the repository at this point in the history
Explicitly check for empty string in response to commands
  • Loading branch information
Capelliexp committed Nov 23, 2022
2 parents bd7a785 + 679e927 commit cea1da6
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions RTProtocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ bool CRTProtocol::SetVersion(int nMajorVersion, int nMinorVersion)
return true;
}

if (pResponseStr)
if (strlen(pResponseStr))
{
sprintf(maErrorStr, "%s.", pResponseStr);
}
Expand Down Expand Up @@ -682,7 +682,7 @@ bool CRTProtocol::SendTrig()
return true;
}
}
if (pResponseStr)
if (strlen(pResponseStr))
{
sprintf(maErrorStr, "%s.", pResponseStr);
}
Expand Down Expand Up @@ -710,7 +710,7 @@ bool CRTProtocol::SetQTMEvent(const char* pLabel)
return true;
}
}
if (pResponseStr)
if (strlen(pResponseStr))
{
sprintf(maErrorStr, "%s.", pResponseStr);
}
Expand Down Expand Up @@ -751,7 +751,7 @@ bool CRTProtocol::TakeControl(const char* pPassword)
return true;
}
}
if (pResponseStr)
if (strlen(pResponseStr))
{
sprintf(maErrorStr, "%s.", pResponseStr);
}
Expand All @@ -777,7 +777,7 @@ bool CRTProtocol::ReleaseControl()
return true;
}
}
if (pResponseStr)
if (strlen(pResponseStr))
{
sprintf(maErrorStr, "%s.", pResponseStr);
}
Expand Down Expand Up @@ -807,7 +807,7 @@ bool CRTProtocol::NewMeasurement()
return true;
}
}
if (pResponseStr)
if (strlen(pResponseStr))
{
sprintf(maErrorStr, "%s.", pResponseStr);
}
Expand All @@ -832,7 +832,7 @@ bool CRTProtocol::CloseMeasurement()
return true;
}
}
if (pResponseStr)
if (strlen(pResponseStr))
{
sprintf(maErrorStr, "%s.", pResponseStr);
}
Expand All @@ -855,7 +855,7 @@ bool CRTProtocol::StartCapture()
return true;
}
}
if (pResponseStr)
if (strlen(pResponseStr))
{
sprintf(maErrorStr, "%s.", pResponseStr);
}
Expand All @@ -878,7 +878,7 @@ bool CRTProtocol::StartRTOnFile()
return true;
}
}
if (pResponseStr)
if (strlen(pResponseStr))
{
if (strcmp(pResponseStr, "RT from file already running") == 0)
{
Expand All @@ -905,7 +905,7 @@ bool CRTProtocol::StopCapture()
return true;
}
}
if (pResponseStr)
if (strlen(pResponseStr))
{
sprintf(maErrorStr, "%s.", pResponseStr);
}
Expand Down Expand Up @@ -936,7 +936,7 @@ bool CRTProtocol::Calibrate(const bool refine, SCalibration &calibrationResult,
}
}
}
if (pResponseStr)
if (strlen(pResponseStr))
{
sprintf(maErrorStr, "%s.", pResponseStr);
}
Expand Down Expand Up @@ -1046,7 +1046,7 @@ bool CRTProtocol::LoadProject(const char* pFileName)
return true;
}
}
if (pResponseStr)
if (strlen(pResponseStr))
{
sprintf(maErrorStr, "%s.", pResponseStr);
}
Expand Down Expand Up @@ -1074,7 +1074,7 @@ bool CRTProtocol::Reprocess()
return true;
}
}
if (pResponseStr)
if (strlen(pResponseStr))
{
sprintf(maErrorStr, "%s.", pResponseStr);
}
Expand Down

0 comments on commit cea1da6

Please sign in to comment.