Skip to content

Commit 67627aa

Browse files
committed
Tue 25 Feb 2020 17:17:58 EST
1 parent eaf0095 commit 67627aa

File tree

1 file changed

+1
-16
lines changed
  • Launchers/retro-esp32/main

1 file changed

+1
-16
lines changed

Launchers/retro-esp32/main/main.c

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,22 +1240,7 @@ void handle_line(char *line) {
12401240
f = fopen(file, "wb");
12411241
fprintf(f, "Favorites List");
12421242
} else {
1243-
int size = 1024, pos;
1244-
int c;
1245-
char *buffer = (char *)malloc(size);
1246-
do { // read all lines in file
1247-
pos = 0;
1248-
do{ // read one line
1249-
c = fgetc(f);
1250-
if(c != EOF) buffer[pos++] = (char)c;
1251-
if(pos >= size - 1) { // increase buffer length - leave room for 0
1252-
size *=2;
1253-
buffer = (char*)realloc(buffer, size);
1254-
}
1255-
} while(c != EOF && c != '\n');
1256-
buffer[pos] = 0;
1257-
handle_line(buffer);
1258-
} while(c != EOF);
1243+
12591244
}
12601245
fclose(f);
12611246
}

0 commit comments

Comments
 (0)