From 459116583258a3a64f086e7780ccf43bb34b1fff Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Mon, 19 Jun 2017 15:57:58 +0200 Subject: [PATCH] memwatch: [cosmetic] print new line after printing 16 bytes The fix in 0ae172613ab52a20a0316ac3f6a21517fce5287b wrongly printed a new line after each value, wich resulted in the following output for a command like this, that reads two 32-bit words: root@ccimx6ulsbc:~# memwatch -r -l 8 -w -a 0x2008008 0x02008008: 0x0070e501 0x00000100 Instead, it should print a line feed after every 16 bytes. Signed-off-by: Hector Palacios --- meta-digi-dey/recipes-digi/memwatch/memwatch/memwatch.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/meta-digi-dey/recipes-digi/memwatch/memwatch/memwatch.c b/meta-digi-dey/recipes-digi/memwatch/memwatch/memwatch.c index 890b2800b..f532a3407 100644 --- a/meta-digi-dey/recipes-digi/memwatch/memwatch/memwatch.c +++ b/meta-digi-dey/recipes-digi/memwatch/memwatch/memwatch.c @@ -243,10 +243,11 @@ int main( int argc, char** argv ) } if( ( verbose < VERB_PRNT_ADDR ) && ( j % 16 == 0 ) ) { + if (j > 0) + printf("\n"); printf( "0x%08lx: ", address + j ); } print_hex_formated( rd_val, access ); - printf("\n"); } else { if( filename != NULL ) { if( ( ret = read( fd_file, &wr_val, access ) ) != access ) { @@ -263,6 +264,7 @@ int main( int argc, char** argv ) } virt_addr += access; } + printf("\n"); if( munmap( map_base, MAP_SIZE ) == -1 ) { fprintf( stderr, "Error unmapping memory\n" );