From 75dfceaa2c578e94202502c7020b80a6e14ce595 Mon Sep 17 00:00:00 2001 From: John Klug Date: Tue, 4 Jun 2024 15:32:44 -0500 Subject: Fix new line issues with mts-io-sysfs show --- src/Device/Device.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Device/Device.cpp b/src/Device/Device.cpp index e743dd6..c440d4f 100644 --- a/src/Device/Device.cpp +++ b/src/Device/Device.cpp @@ -719,11 +719,11 @@ int Device::getPinValue(const std::string &name, std::string *data) if(lv != GPIOD_LINE_VALUE_ERROR) { if(lv == GPIOD_LINE_VALUE_INACTIVE) { if(data != NULL) - *data = "0"; + *data = "0\n"; return 0; } else { if(data != NULL) { - *data = "1"; + *data = "1\n"; return 0; } else return 1; @@ -758,7 +758,7 @@ void Device::show(std::string name) { } result = getPinValue(name,&fileData); if (result == 0) - printf("%s\n", fileData.c_str()); + printf("%s", fileData.c_str()); exitHandler(result); } // End of show -- cgit v1.2.3