From 25b1feb71ddf6a56af6943904f6de7b82503bb92 Mon Sep 17 00:00:00 2001 From: Arti Zirk Date: Tue, 11 Oct 2016 00:43:31 +0300 Subject: [PATCH] make format --- src/main.c | 1 - src/print_helper.c | 14 +++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/main.c b/src/main.c index 52843f3..41f3820 100644 --- a/src/main.c +++ b/src/main.c @@ -61,7 +61,6 @@ int main (void) lcd_puts_P(PSTR(" ")); /* Clear the end of the line */ lcd_goto(0x40); /* Got to the beginning of the next line */ - /* set pin 3 low to turn led off */ PORTA &= ~_BV(PORTA3); _delay_ms(BLINK_DELAY_MS); diff --git a/src/print_helper.c b/src/print_helper.c index 995a47b..69f6d7f 100644 --- a/src/print_helper.c +++ b/src/print_helper.c @@ -1,27 +1,31 @@ #include #include "print_helper.h" -int print_ascii_tbl (FILE *stream) { +int print_ascii_tbl (FILE *stream) +{ for (char c = ' '; c <= '~'; c++) { - if(!fprintf(stream, "%c ", c)) { + if (!fprintf(stream, "%c ", c)) { return 0; } } + return fprintf(stream, "\n"); } -int print_for_human (FILE *stream, const unsigned char *array, const int len) { +int print_for_human (FILE *stream, const unsigned char *array, const int len) +{ for (int i = 0; i < len; i++) { if (array[i] >= ' ' && array[i] <= '~') { - if(!fprintf(stream, "%c", array[i])) { + if (!fprintf(stream, "%c", array[i])) { return 0; } } else { - if(!fprintf(stream, "\"0x%02x\"", array[i])) { + if (!fprintf(stream, "\"0x%02x\"", array[i])) { return 0; } } } + return fprintf(stream, "\n");; }