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 3 years ago committed by Christoph Lohmann
parent e53298ab1f
commit 79fcfa10f4

@ -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();

Loading…
Cancel
Save