Ethereal-dev: Re: [Ethereal-dev] packet-sccp.c patch for compilation under Win32

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Gilbert Ramirez <gram@xxxxxxxxxxxxxxx>
Date: 06 Mar 2002 10:44:15 -0600
On Wed, 2002-03-06 at 10:22, Motonori Shindo wrote:
> Hi,
> --- packet-sccp.c       2002/03/05 00:09:21     1.2
> +++ packet-sccp.c       2002/03/06 10:33:26
> @@ -902,7 +902,7 @@
>      /* Dissect SSN (if present) */
>      if (ssni) {
>        ssn = tvb_get_guint8(tvb, offset);
> -      called ? called_ssn : calling_ssn = ssn;
> +      called ? called_ssn : (calling_ssn = ssn);
>  
>        proto_tree_add_uint(call_tree, called ? hf_sccp_called_ssn
>                                             : hf_sccp_calling_ssn,
> @@ -944,7 +944,7 @@
>      /* Dissect SSN (if present) */
>      if (ssni) {
>        ssn = tvb_get_guint8(tvb, offset);
> -      called ? called_ssn : calling_ssn = ssn;
> +      called ? called_ssn : (calling_ssn = ssn);
>  
>        proto_tree_add_uint(call_tree, called ? hf_sccp_called_ssn
>                                             : hf_sccp_calling_ssn,
> ----


Sorry to be critical, but that code is ugly. Why not this:

if (!called) {
	calling_ssn = ssn;
}

There's no need to reference 'called_ssn' at all.

--gilbert