add scary warnings

This commit is contained in:
randomuser 2022-09-19 13:31:20 -05:00
parent a4ea977c68
commit f44a1c3ffe
1 changed files with 2 additions and 0 deletions

2
bspc.c
View File

@ -307,10 +307,12 @@ int main(void) {
for(int i = 0; i < 64; i++) { for(int i = 0; i < 64; i++) {
if(final[i] == '\0') { if(final[i] == '\0') {
/* XXX: susceptible to buffer underflow */
if (i) final[i - 1] = '\0'; if (i) final[i - 1] = '\0';
break; break;
} }
if(isdigit(final[i]) && *current == final[i]) if(isdigit(final[i]) && *current == final[i])
/* XXX: susceptible to buffer overflow */
final[i + 1] = '<'; final[i + 1] = '<';
if(final[i] == '\n') if(final[i] == '\n')
final[i] = ' '; final[i] = ' ';