fix newline

This commit is contained in:
Syping 2021-04-23 12:53:29 +02:00
parent 85196faccd
commit b48eda46de
2 changed files with 2 additions and 2 deletions

View File

@ -112,7 +112,7 @@ int getdhtstring(int PIN, char* string)
temp *= -1.0f;
}
sprintf(string, "{\"humidity\": %.1f, \"temp\": %.1f}\n", humid, temp);
sprintf(string, "{\"humidity\": %.1f, \"temp\": %.1f}", humid, temp);
gpio_close(handle);
return 0;

View File

@ -44,7 +44,7 @@ int main(int argc, char *argv[])
char *dhtstring = static_cast<char*>(malloc(512));
int result = getdhtstring(PIN, dhtstring);
if (result == 0) {
dhtJson = QByteArray(dhtstring).trimmed();
dhtJson = QByteArray(dhtstring);
}
free(dhtstring);
});