commit 29b1fa9c76379804b63dee3ab2268462025d557b
parent 94a0e5efc331e32b15fec8032bf4d828b8b97783
Author: Lazaros Koromilas <lostd@2f30.org>
Date: Sat, 9 Feb 2019 20:14:43 +0200
Revert "Remove printslide()"
This reverts commit cd3bb0fb510fc579df73e98fd06bf84826089eef.
Diffstat:
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/catpoint.c b/catpoint.c
@@ -16,6 +16,12 @@ struct slide {
size_t siz;
};
+static void
+printslide(struct slide *s)
+{
+ printf("%.*s", (int)s->siz, s->buf);
+}
+
int
main(int argc, char *argv[])
{
@@ -58,8 +64,9 @@ main(int argc, char *argv[])
/* start */
i = 0;
show:
- /* clear screen and display slide */
- printf("\x1b[2J\x1b[H" "%.*s", (int)s[i].siz, s[i].buf);
+ /* display slide */
+ printf("\x1b[2J\x1b[H"); /* clear */
+ printslide(&s[i]);
again:
c = getchar();
switch (c) {