wdvi

network DVI viewer
Log | Files | Refs

commit 8214b43ca8b9a99c455098603fd6c980269b875d
parent 6569653f436cb40a747480f37f6e8a8c5b795707
Author: Kyle Milz <krwmilz@gmail.com>
Date:   Thu,  9 Mar 2023 03:56:20 +0000

cleanup read_special()

- ansi function signature
- indentation
- if statement bodies on newline

Diffstat:
Mdvi-draw.c | 32+++++++++++++++++---------------
1 file changed, 17 insertions(+), 15 deletions(-)

diff --git a/dvi-draw.c b/dvi-draw.c @@ -518,30 +518,32 @@ open_font_file(struct font *fontp) */ static char * -read_special(nbytes) - long nbytes; +read_special(long nbytes) { static char *spcl = NULL; static long spcl_len = -1; char *p; if (spcl_len < nbytes) { - if (spcl != NULL) free(spcl); - spcl = xmalloc((unsigned) nbytes + 1); - spcl_len = nbytes; + if (spcl != NULL) + free(spcl); + spcl = xmalloc((unsigned) nbytes + 1); + spcl_len = nbytes; } p = spcl; for (;;) { - int i = currinf.end - currinf.pos; - - if (i > nbytes) i = nbytes; - bcopy((char *) currinf.pos, p, i); - currinf.pos += i; - p += i; - nbytes -= i; - if (nbytes == 0) break; - (void) xxone(); - --currinf.pos; + int i = currinf.end - currinf.pos; + + if (i > nbytes) + i = nbytes; + bcopy((char *) currinf.pos, p, i); + currinf.pos += i; + p += i; + nbytes -= i; + if (nbytes == 0) + break; + (void) xxone(); + --currinf.pos; } *p = '\0'; return spcl;