catpoint

simple slides viewer
git clone git://git.2f30.org/catpoint.git
Log | Files | Refs | README | LICENSE

commit 06f22fa867c957454b2ca21299fc329a115d343a
parent 40933710708d54d6a40e52561635e87956a5fdbe
Author: FRIGN <dev@frign.de>
Date:   Fri Jul 11 11:53:13 +0200

Use printf-idioms

for printing a fixed-size char-array. This reduces hundreds of
calls to just one for each slide.

Diffstat:
catpoint.c | 6+-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/catpoint.c b/catpoint.c @@ -20,11 +20,7 @@ struct slide { static void printslide(struct slide *s) { - char *p = s->buf; - size_t i; - - for (i = 0; i < s->siz; i++) - printw("%c", *p++); + printw("%.*s", (int)s->siz, s->buf); } int