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; temp *= -1.0f;
} }
sprintf(string, "{\"humidity\": %.1f, \"temp\": %.1f}\n", humid, temp); sprintf(string, "{\"humidity\": %.1f, \"temp\": %.1f}", humid, temp);
gpio_close(handle); gpio_close(handle);
return 0; return 0;

View file

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