Fix traffic analyzer developer build

Jeremy Allison jra at samba.org
Thu Mar 18 16:30:42 MDT 2010


On Thu, Mar 18, 2010 at 11:15:02PM +0100, Holger Hetterich wrote:

>  static char *smb_traffic_analyzer_create_header( TALLOC_CTX *ctx,
> -	const char *state_flags, size_t data_len)
> +	const char *state_flags, int data_len)
>  {
> -	char *header = talloc_asprintf( ctx, "V2.%s%017u",
> +	char *header = talloc_asprintf( ctx, "V2.%s%017d",
>  					state_flags, data_len);

In cases like this, rather than change data_len from an
unsigned size_t to a signed int, for a value that can
never be negative, just to fix a talloc_asprintf format,
just add a cast to the asprintf. i.e. the change should
be:

> -                                     state_flags, data_len);
> +                                     state_flags, (unsigned int)data_len);

instead of changing the aprintf format from "%u" -> "%d".

Jeremy.


More information about the samba-technical mailing list