Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong comparison of strings #27

Open
kuramayoko10 opened this issue Oct 2, 2015 · 3 comments
Open

Wrong comparison of strings #27

kuramayoko10 opened this issue Oct 2, 2015 · 3 comments

Comments

@kuramayoko10
Copy link

the method videoInput::getDeviceIDFromName(char * name) is implemented incorrectly. It is comparing two pointers (char*) instead of strings.

Is order to solve this, simply use the c function strcmp(char*,char*) like so:

int videoInput::getDeviceIDFromName(char * name) {
    if (listDevices(true) == 0) return -1;
    int deviceID = -1;
    for (int i = 0; i < VI_MAX_CAMERAS; i++) {
        if (strcmp(deviceNames[i], name) == 0) {
            deviceID = i;
            break;
        }
    }
    return deviceID;
}
@MIvanchev
Copy link

This issue is a clone of #20.

@ofTheo
Copy link
Owner

ofTheo commented Nov 13, 2017 via email

@MIvanchev
Copy link

Sure thing, I'll hit you up with a PR =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants