From 85ed4cfb712410b0df370faf11ef87facaf56aa0 Mon Sep 17 00:00:00 2001 From: solar Date: Fri, 7 Apr 2006 05:13:15 +0000 Subject: [PATCH] All tests except hex / zero work. --- draft.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/draft.c b/draft.c index fdda32d..740def7 100644 --- a/draft.c +++ b/draft.c @@ -50,7 +50,7 @@ struct status_t s - the buffer into which the character shall be delivered TODO: Overruns. */ -#define DELIVER( x ) if ( status->i < status->n ) status->s[status->i] = x; ++(status->i) +#define DELIVER( x ) do { if ( status->i < status->n ) status->s[status->i] = x; ++(status->i); } while ( 0 ) /* TODO: Left / right alignment - requires track-keeping of width and printed chars. "Father function", die für right alignment "tail recursive" gerufen wird, und @@ -139,9 +139,9 @@ static void padwrap( int value, struct status_t * status ) ++(status->this); } } - if ( status->i == status->n ) + if ( status->i >= status->n ) { - status->s[status->i] = '\0'; + status->s[status->n - 1] = '\0'; } } -- 2.40.0