summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorExplorer09 <explorer09@gmail.com>2017-09-22 17:27:02 +0800
committerWill Estes <westes575@gmail.com>2017-10-05 11:27:54 -0400
commit37a6184dabcd82fa1d17c24c000f3da469296195 (patch)
treef1e4f1015ed46a4e59fc0f4d904cb269ebd2786c
parent24fd0551333e7eded87b64dd36062da3df2f6380 (diff)
scanner: Simplify PRINT_SPACES() macro
-rw-r--r--src/scanopt.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/scanopt.c b/src/scanopt.c
index 7745c11..0b6d7d1 100644
--- a/src/scanopt.c
+++ b/src/scanopt.c
@@ -366,14 +366,8 @@ int scanopt_usage (scanopt_t *scanner, FILE *fp, const char *usage)
}
desccol = maxlen[0] + indent * 2;
-#define PRINT_SPACES(fp,n)\
- do{\
- int _n;\
- _n=(n);\
- while(_n-- > 0)\
- fputc(' ',(fp));\
- }while(0)
-
+#define PRINT_SPACES(fp,n) \
+ fprintf((fp), "%*s", (n), "")
/* Second pass (same as above loop), this time we print. */
/* Sloppy hack: We iterate twice. The first time we print short and long options.