summaryrefslogtreecommitdiff
path: root/files.c
diff options
context:
space:
mode:
Diffstat (limited to 'files.c')
-rw-r--r--files.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/files.c b/files.c
index 245b29b..17743a5 100644
--- a/files.c
+++ b/files.c
@@ -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);
}