Fix cppcheck warning "buffer may not be null-terminated after call to strncpy()"

This commit is contained in:
Philippe Teuwen
2013-03-06 12:38:59 +01:00
parent 3e773ab494
commit 1d5f9956fb
5 changed files with 5 additions and 0 deletions

View File

@@ -226,6 +226,7 @@ nfc_open(nfc_context *context, const nfc_connstring connstring)
}
} else {
strncpy(ncs, connstring, sizeof(nfc_connstring));
ncs[sizeof(nfc_connstring) - 1] = '\0';
}
// Search through the device list for an available device