diff options
author | GDR! <gdr@gdr.name> | 2020-08-15 18:50:44 +0200 |
---|---|---|
committer | GDR! <gdr@gdr.name> | 2020-08-15 18:50:44 +0200 |
commit | 0a8b0399cfac7873d350e4b2a90ec5203178922c (patch) | |
tree | 439ff4570808d3ab412873b6a456485b6b9d0edc | |
parent | b139b0dfe6e2aa25f35b1956093d2fd9f26f4f2d (diff) |
Fix gcc warnings about strncpy
-rw-r--r-- | main.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -727,7 +727,7 @@ static void write_save(Tox *tox) | |||
727 | data = malloc(size); | 727 | data = malloc(size); |
728 | tox_get_savedata(tox, data); | 728 | tox_get_savedata(tox, data); |
729 | 729 | ||
730 | strncpy((char *)path_real, config_path, sizeof(config_path)); | 730 | strncpy((char *)path_real, config_path, sizeof(path_real)); |
731 | 731 | ||
732 | p = path_real + strlen((char *)path_real); | 732 | p = path_real + strlen((char *)path_real); |
733 | memcpy(p, "tox_save", sizeof("tox_save")); | 733 | memcpy(p, "tox_save", sizeof("tox_save")); |
@@ -770,7 +770,7 @@ static size_t load_save(uint8_t **out_data) | |||
770 | uint32_t size; | 770 | uint32_t size; |
771 | uint8_t path_real[512], *p; | 771 | uint8_t path_real[512], *p; |
772 | 772 | ||
773 | strncpy((char *)path_real, config_path, sizeof(config_path)); | 773 | strncpy((char *)path_real, config_path, sizeof(path_real)); |
774 | 774 | ||
775 | p = path_real + strlen((char *)path_real); | 775 | p = path_real + strlen((char *)path_real); |
776 | memcpy(p, "tox_save", sizeof("tox_save")); | 776 | memcpy(p, "tox_save", sizeof("tox_save")); |