diff options
author | Erich Eckner <git@eckner.net> | 2020-09-07 13:42:32 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2020-09-07 13:42:32 +0200 |
commit | 3f14bec46444fc0696b706e013ec716c3bed9b5d (patch) | |
tree | 9845a1789bd78144466f0e32ec5c7b30a71e4c76 | |
parent | df22be10087a70feef310edeb1ba3c2a7bf1b826 (diff) | |
download | anzeige-3f14bec46444fc0696b706e013ec716c3bed9b5d.tar.xz |
strcpy -> strncpy
-rw-r--r-- | anzeige.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; } } |