1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Merge pull request #1007 from jubalh/memcpy

Fix gcc8 error about strncpy
This commit is contained in:
Michael Vetter 2018-07-28 11:46:44 +02:00 committed by GitHub
commit fbf645b75c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -228,7 +228,7 @@ _rotate_log_file(void)
size_t len = strlen(log_file); size_t len = strlen(log_file);
char *log_file_new = malloc(len + 3); char *log_file_new = malloc(len + 3);
strncpy(log_file_new, log_file, len); memcpy(log_file_new, log_file, len);
log_file_new[len] = '.'; log_file_new[len] = '.';
log_file_new[len+1] = '1'; log_file_new[len+1] = '1';
log_file_new[len+2] = 0; log_file_new[len+2] = 0;