From f3bb876e3422b8b2f16b0a2ef93cfde924fe19ee Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Sun, 1 Nov 2009 07:44:32 +0000 Subject: Replaced putchar() loop with fwrite() (noted by Joerg Sonnenberger). --- chars.c | 4 ++-- html.c | 12 ++++-------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/chars.c b/chars.c index 880a1f6d..7ce4666d 100644 --- a/chars.c +++ b/chars.c @@ -1,4 +1,4 @@ -/* $Id: chars.c,v 1.11 2009/10/31 06:10:57 kristaps Exp $ */ +/* $Id: chars.c,v 1.12 2009/11/01 07:44:32 kristaps Exp $ */ /* * Copyright (c) 2009 Kristaps Dzonsons * @@ -35,7 +35,7 @@ struct ln { int type; #define CHARS_CHAR (1 << 0) #define CHARS_STRING (1 << 1) -#define CHARS_BOTH (0x03) +#define CHARS_BOTH (CHARS_CHAR | CHARS_STRING) }; #define LINES_MAX 351 diff --git a/html.c b/html.c index 643896ef..7ed94c9a 100644 --- a/html.c +++ b/html.c @@ -1,4 +1,4 @@ -/* $Id: html.c,v 1.75 2009/10/31 06:10:57 kristaps Exp $ */ +/* $Id: html.c,v 1.76 2009/11/01 07:44:32 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -18,8 +18,8 @@ #include #include -#include #include +#include #include #include #include @@ -189,15 +189,13 @@ static void print_spec(struct html *h, const char *p, int len) { const char *rhs; - int i; size_t sz; rhs = chars_a2ascii(h->symtab, p, (size_t)len, &sz); if (NULL == rhs) return; - for (i = 0; i < (int)sz; i++) - putchar(rhs[i]); + fwrite(rhs, 1, sz, stdout); } @@ -205,15 +203,13 @@ static void print_res(struct html *h, const char *p, int len) { const char *rhs; - int i; size_t sz; rhs = chars_a2res(h->symtab, p, (size_t)len, &sz); if (NULL == rhs) return; - for (i = 0; i < (int)sz; i++) - putchar(rhs[i]); + fwrite(rhs, 1, sz, stdout); } -- cgit v1.2.3