From 4a72dab02a719922d2c7ed92b0687b091d128c8b Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Fri, 1 Mar 2019 21:17:16 +1100 Subject: [PATCH] [c-host] linux: correct device name comparison --- c-host/linux/platform.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/c-host/linux/platform.c b/c-host/linux/platform.c index 37e554c5..62c9d656 100644 --- a/c-host/linux/platform.c +++ b/c-host/linux/platform.c @@ -104,9 +104,15 @@ int main(int argc, char * argv[]) name[len] = '\0'; close(fd); + while(len > 0 && name[len-1] == '\n') + { + --len; + name[len] = '\0'; + } + if (strcmp(name, "KVMFR") != 0) { - DEBUG_ERROR("Device is not a KVMFR device %s reports as %s", file, name); + DEBUG_ERROR("Device is not a KVMFR device \"%s\" reports as: %s", file, name); return -1; } } @@ -149,6 +155,8 @@ int main(int argc, char * argv[]) DEBUG_ERROR("Failed to open: %s", file); return -1; } + + DEBUG_INFO("KVMFR Device : %s", file); } bool termSig = false;