А typo leads to improper pnd->name initialization
A for loop condition is always false so pnd->name is not initialized. This results in garbage when printing device name.
This commit is contained in:
parent
24979c65cc
commit
10398b6bd9
1 changed files with 1 additions and 1 deletions
|
@ -276,7 +276,7 @@ nfc_open(nfc_context *context, const nfc_connstring connstring)
|
||||||
log_put(LOG_GROUP, LOG_CATEGORY, NFC_LOG_PRIORITY_DEBUG, "Unable to open \"%s\".", ncs);
|
log_put(LOG_GROUP, LOG_CATEGORY, NFC_LOG_PRIORITY_DEBUG, "Unable to open \"%s\".", ncs);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
for (uint32_t i = 0; i > context->user_defined_device_count; i++) {
|
for (uint32_t i = 0; i < context->user_defined_device_count; i++) {
|
||||||
if (strcmp(ncs, context->user_defined_devices[i].connstring) == 0) {
|
if (strcmp(ncs, context->user_defined_devices[i].connstring) == 0) {
|
||||||
// This is a device sets by user, we use the device name given by user
|
// This is a device sets by user, we use the device name given by user
|
||||||
strcpy(pnd->name, context->user_defined_devices[i].name);
|
strcpy(pnd->name, context->user_defined_devices[i].name);
|
||||||
|
|
Loading…
Reference in a new issue