print the exact amount of mmap'd data

It could read past the mmap'd region (not using the NUL terminator).

Signed-off-by: Christoph Lohmann <20h@r-36.net>
master
Hiltjo Posthuma 2020-12-20 15:49:57 +01:00 committed by Christoph Lohmann
parent e53298ab1f
commit 79fcfa10f4
1 changed files with 2 additions and 2 deletions

View File

@ -63,7 +63,7 @@ reloadcurrentslide(int sig)
if (sig == SIGHUP) {
clear();
refresh();
printw("%s", currentslidep);
printw("%.*s", currentslidelen, currentslidep);
}
}
@ -109,7 +109,7 @@ show:
loadcurrentslide(slidefiles, currentslide);
clear();
refresh();
printw("%s", currentslidep);
printw("%.*s", currentslidelen, currentslidep);
again:
c = getch();