memwatch: [cosmetic] print new line after printing 16 bytes

The fix in 0ae172613a 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 <hector.palacios@digi.com>
This commit is contained in:
Hector Palacios 2017-06-19 15:57:58 +02:00
parent 5126a6049b
commit 4591165832
1 changed files with 3 additions and 1 deletions

View File

@ -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" );