Mercurial > hg > dmlib
changeset 2427:f07e3e66ca58
Cleanup.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 27 Jan 2020 09:40:06 +0200 |
parents | bb7264ddaefd |
children | 09082816665d |
files | tools/data2inc.c |
diffstat | 1 files changed, 10 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/tools/data2inc.c Tue Jan 21 07:54:54 2020 +0200 +++ b/tools/data2inc.c Mon Jan 27 09:40:06 2020 +0200 @@ -209,17 +209,22 @@ static void dmPrintIndentation(FILE *fh) { + int level; + const char *str; + if (optIndentation < 0) { - for (int i = 0; i < -optIndentation; i++) - fputs("\t", fh); + level = - optIndentation; + str = "\t"; } else - if (optIndentation > 0) { - for (int i = 0; i < optIndentation; i++) - fputs(" ", fh); + level = optIndentation; + str = " "; } + + for (int i = 0; i < level; i++) + fputs(str, fh); }