On Sat, 22 Dec 2007, Geoff Levand wrote:
> +static void dump_field(char *s, const u8 *f, unsigned int size)
> +{
> +#if defined(DEBUG)
> +     unsigned int i;
> +
> +     for (i = 0; i < size; i++)
> +             s[i] = isprint(f[i]) ? f[i] : '.';
> +     s[i] = 0;
> +#endif
> +}

Sorry for nitpicking again.

Usually the _length_ of a C-string is the number of characters, while the
_size_ of a C-string includes the zero-terminator.

In dump_field() it writes size+1 bytes to s.

With kind regards,
 
Geert Uytterhoeven
Software Architect

Sony Network and Software Technology Center Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium
 
Phone:    +32 (0)2 700 8453     
Fax:      +32 (0)2 700 8622     
E-mail:   [EMAIL PROTECTED]     
Internet: http://www.sony-europe.com/
        
Sony Network and Software Technology Center Europe      
A division of Sony Service Centre (Europe) N.V. 
Registered office: Technologielaan 7 · B-1840 Londerzeel · Belgium      
VAT BE 0413.825.160 · RPR Brussels      
Fortis Bank Zaventem · Swift GEBABEBB08A · IBAN BE39001382358619
_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Reply via email to