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:
parent
5126a6049b
commit
4591165832
|
|
@ -243,10 +243,11 @@ int main( int argc, char** argv )
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ( verbose < VERB_PRNT_ADDR ) && ( j % 16 == 0 ) ) {
|
if( ( verbose < VERB_PRNT_ADDR ) && ( j % 16 == 0 ) ) {
|
||||||
|
if (j > 0)
|
||||||
|
printf("\n");
|
||||||
printf( "0x%08lx: ", address + j );
|
printf( "0x%08lx: ", address + j );
|
||||||
}
|
}
|
||||||
print_hex_formated( rd_val, access );
|
print_hex_formated( rd_val, access );
|
||||||
printf("\n");
|
|
||||||
} else {
|
} else {
|
||||||
if( filename != NULL ) {
|
if( filename != NULL ) {
|
||||||
if( ( ret = read( fd_file, &wr_val, access ) ) != access ) {
|
if( ( ret = read( fd_file, &wr_val, access ) ) != access ) {
|
||||||
|
|
@ -263,6 +264,7 @@ int main( int argc, char** argv )
|
||||||
}
|
}
|
||||||
virt_addr += access;
|
virt_addr += access;
|
||||||
}
|
}
|
||||||
|
printf("\n");
|
||||||
|
|
||||||
if( munmap( map_base, MAP_SIZE ) == -1 ) {
|
if( munmap( map_base, MAP_SIZE ) == -1 ) {
|
||||||
fprintf( stderr, "Error unmapping memory\n" );
|
fprintf( stderr, "Error unmapping memory\n" );
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue