diff options
Diffstat (limited to 'files.c')
-rw-r--r-- | files.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -50,8 +50,12 @@ void load_file(FILE *fc){ get_string(fc, "Load file: ", newfname, 255); if ((fin=fopen(newfname, "r")) != NULL){ i = 0; - while((fgets(screen.l[i].s, WIDTH+2, fin)) != NULL && i<HEIGHT) - screen.l[i++].s[WIDTH-1]='\0'; + while((fgets(screen.l[i].s, WIDTH+1, fin)) != NULL && i<HEIGHT){ + screen.l[i].lst = strlen(screen.l[i].s) - 1; + screen.l[i].n = i; + screen.l[i].s[strlen(screen.l[i].s)-1]='\0'; + i++; + } for(;i<HEIGHT; i++){ erase_line(i); } |