Cosmetic change into tdbtool.c

Arcady Chernyak Arcady.Chernyak at efi.com
Mon Apr 14 17:56:00 GMT 2003


I suggest to change function print_asc() (tdbtool.c)
from:
static void print_asc(unsigned char *buf,int len)
{
	int i;

	/* We're probably printing ASCII strings so don't try to display
	   the trailing NULL character. */
	if (buf[len - 1] == 0)
	        len--;

	for (i=0;i<len;i++)
		printf("%c",isprint(buf[i])?buf[i]:'.');
}
To:
static void print_asc(unsigned char *buf,int len)
{
	int i;

	/* We're probably printing ASCII strings so don't try to display
	   the trailing NULL character. */

	for (i=0;i<len;i++){
		if((len - 1 == i) && (0 == buf[i])){
			printf("%c",' ');
			continue;	
		}
		printf("%c",isprint(buf[i])?buf[i]:'.');
 	}
}
It keeps length of printed string the same and output looks better.
Regards
	Arcady




More information about the samba-technical mailing list