Closed hyyoxhk closed 1 year ago
Replacing strncpy with strcpy fixes this warnings References: https://stackoverflow.com/questions/53408543/strncat-wformat-overflow-warning-when-using-gcc-8-2-1
qrenc.c:797:25: warning: ‘strncat’ specified bound 2 equals source length [-Wstringop-overflow=] 797 | strncat(buffer, " ", 2); | ^~~~~~~~ qrenc.c:811:25: warning: ‘strncat’ specified bound 2 equals source length [-Wstringop-overflow=] 811 | strncat(buffer, " ", 2); | ^~~~~~~~ qrenc.c:818:25: warning: ‘strncat’ specified bound 2 equals source length [-Wstringop-overflow=] 818 | strncat(buffer, " ", 2); | ^~~~~~~~ qrenc.c:820:17: warning: ‘strncat’ specified bound 5 equals source length [-Wstringop-overflow=] 820 | strncat(buffer, "\033[0m\n", 5); | ^~~~~~~
Replacing strncpy with strcpy fixes this warnings References: https://stackoverflow.com/questions/53408543/strncat-wformat-overflow-warning-when-using-gcc-8-2-1
qrenc.c:797:25: warning: ‘strncat’ specified bound 2 equals source length [-Wstringop-overflow=] 797 | strncat(buffer, " ", 2); | ^
~~~~~~~ qrenc.c:811:25: warning: ‘strncat’ specified bound 2 equals source length [-Wstringop-overflow=] 811 | strncat(buffer, " ", 2); | ^~~~~~~~ qrenc.c:818:25: warning: ‘strncat’ specified bound 2 equals source length [-Wstringop-overflow=] 818 | strncat(buffer, " ", 2); | ^~~~~~~~ qrenc.c:820:17: warning: ‘strncat’ specified bound 5 equals source length [-Wstringop-overflow=] 820 | strncat(buffer, "\033[0m\n", 5); | ^~~~~~~