summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2020-09-07 13:42:32 +0200
committerErich Eckner <git@eckner.net>2020-09-07 13:42:32 +0200
commit3f14bec46444fc0696b706e013ec716c3bed9b5d (patch)
tree9845a1789bd78144466f0e32ec5c7b30a71e4c76
parentdf22be10087a70feef310edeb1ba3c2a7bf1b826 (diff)
downloadanzeige-3f14bec46444fc0696b706e013ec716c3bed9b5d.tar.xz
strcpy -> strncpy
-rw-r--r--anzeige.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/anzeige.c b/anzeige.c
index b28dd62..6f906d9 100644
--- a/anzeige.c
+++ b/anzeige.c
@@ -101,7 +101,7 @@ int main(int argc, char **argv)
for (int i=0; i<THREAD_IDX_MAX; i++)
if (input_threads[i].output_ready) {
if (strcmp(text_buffers[i], input_threads[i].text_output)) {
- strcpy(text_buffers[i], input_threads[i].text_output);
+ strncpy(text_buffers[i], input_threads[i].text_output, MAX_TEXT_OUTPUT_LEN);
updated = 1;
}
if (i == THREAD_IDX_OUTSIDE) {
@@ -128,7 +128,7 @@ int main(int argc, char **argv)
inside_humidity
);
if (strcmp(text_buffers[THREAD_IDX_INSIDE], humidity_text_buffer)) {
- strcpy(text_buffers[THREAD_IDX_INSIDE], humidity_text_buffer);
+ strncpy(text_buffers[THREAD_IDX_INSIDE], humidity_text_buffer, MAX_TEXT_OUTPUT_LEN);
updated = 1;
}
}