print the exact amount of mmap'd data - catpoint - Catpoint simple presenting software. HTML git clone git://bitreich.org/catpoint/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/catpoint/ DIR Log DIR Files DIR Refs DIR Tags DIR README DIR LICENSE --- DIR commit 79fcfa10f48e539001da1288f7a084f07b895abf DIR parent e53298ab1f62fbae87d2c139e30ead81a400d0ce HTML Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Sun, 20 Dec 2020 15:49:57 +0100 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> Diffstat: M catpoint.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- DIR diff --git a/catpoint.c b/catpoint.c @@ -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();