Fixed segfault

This commit is contained in:
leca 2023-02-13 11:17:52 +03:00
parent a1c8231640
commit f138448100
3 changed files with 5 additions and 3 deletions

2
.gitignore vendored
View File

@ -1,3 +1,5 @@
test.txt
# ---> C
# Prerequisites
*.d

4
main.c
View File

@ -33,7 +33,7 @@ int main (int argc, char* argv[]) {
noecho();
char ch = ' ';
int len = 0;
char* cmd_string = malloc(cols);
char* cmd_string = malloc(128);
char (*content)[cols] = malloc(sizeof(char[rows][cols+1]));
for (int i = 0; i < rows; i ++) {
@ -52,7 +52,7 @@ int main (int argc, char* argv[]) {
insertInStartContent(content, cmd_string);
len = 0;
clearInput(rows, cols);
cmd_string = "";
cmd_string = malloc(128);
refresh();
break;
}

View File

@ -1 +1 @@
test: test
test: aadsd test