Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ngscopeclient/scopehal-apps
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ec09bc1fcdc2
Choose a base ref
...
head repository: ngscopeclient/scopehal-apps
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 42f16d3c1c34
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Mar 11, 2020

  1. Copy the full SHA
    42f16d3 View commit details
Showing with 4 additions and 12 deletions.
  1. +4 −12 glscopeclient/main.cpp
16 changes: 4 additions & 12 deletions glscopeclient/main.cpp
Original file line number Diff line number Diff line change
@@ -224,27 +224,19 @@ int main(int argc, char* argv[])
{
//Scope format: name:api:host[:port]
char nick[128];
char api[128];
char driver[128];
char trans[128];
char host[128];
int port = 0;
if(4 != sscanf(s.c_str(), "%127[^:]:%127[^:]:%127[^:]:%d", nick, api, host, &port))
if(5 != sscanf(s.c_str(), "%127[^:]:%127[^:]:%127[^:]:%127[^:]:%d", nick, driver, trans, host, &port))
{
if(3 != sscanf(s.c_str(), "%127[^:]:%127[^:]:%127[^:]", nick, api, host))
if(4 != sscanf(s.c_str(), "%127[^:]:%127[^:]:%127[^:]:%127[^:]", nick, driver, trans, host))
{
LogError("Invalid scope string %s\n", s.c_str());
continue;
}
}

//API is formatted as driver_transport
char driver[128];
char trans[128];
if(2 != sscanf(api, "%127[^_]_%127s", driver, trans))
{
LogError("Invalid API %s\n", api);
continue;
}

//Special case default ports depending on protocol
string sdriver = driver;
string strans = trans;