From f1468912a7106fcfb5a46505dff4374594f12948 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Fri, 29 May 2009 15:10:23 -0700 Subject: [PATCH] Run Nindent on com32/lib/fgets.c Automatically reformat com32/lib/fgets.c using Nindent. Do this for all files except HDT, gPXE and externally maintained libraries (zlib, tinyjpeg, libpng). Signed-off-by: H. Peter Anvin --- com32/lib/fgets.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/com32/lib/fgets.c b/com32/lib/fgets.c index 474de49..7bc1519 100644 --- a/com32/lib/fgets.c +++ b/com32/lib/fgets.c @@ -8,24 +8,24 @@ #include -char *fgets(char *s, int n, FILE *f) +char *fgets(char *s, int n, FILE * f) { - int ch; - char *p = s; + int ch; + char *p = s; - while ( n > 1 ) { - ch = getc(f); - if ( ch == EOF ) { - *p = '\0'; - return (p == s) ? NULL : s; + while (n > 1) { + ch = getc(f); + if (ch == EOF) { + *p = '\0'; + return (p == s) ? NULL : s; + } + *p++ = ch; + if (ch == '\n') + break; + n--; } - *p++ = ch; - if ( ch == '\n' ) - break; - n--; - } - if ( n ) - *p = '\0'; + if (n) + *p = '\0'; - return s; + return s; } -- 2.7.4