Automatically reformat com32/lib/fwrite.c using Nindent.
Do this for all files except HDT, gPXE and externally maintained
libraries (zlib, tinyjpeg, libpng).
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
#include <unistd.h>
#include <stdio.h>
-size_t _fwrite(const void *buf, size_t count, FILE *f)
+size_t _fwrite(const void *buf, size_t count, FILE * f)
{
- size_t bytes = 0;
- ssize_t rv;
- const char *p = buf;
+ size_t bytes = 0;
+ ssize_t rv;
+ const char *p = buf;
- while ( count ) {
- rv = write(fileno(f), p, count);
- if ( rv == -1 ) {
- if ( errno == EINTR || errno == EAGAIN )
- continue;
- else
- break;
- } else if ( rv == 0 ) {
- break;
- }
+ while (count) {
+ rv = write(fileno(f), p, count);
+ if (rv == -1) {
+ if (errno == EINTR || errno == EAGAIN)
+ continue;
+ else
+ break;
+ } else if (rv == 0) {
+ break;
+ }
- p += rv;
- bytes += rv;
- count -= rv;
- }
+ p += rv;
+ bytes += rv;
+ count -= rv;
+ }
- return bytes;
+ return bytes;
}