Ethereal-dev: Re: [Ethereal-dev] [Patch] Change of behaviour in get_addr_name

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

From: "Francisco Alcoba (TS/EEM)" <francisco.alcoba@xxxxxxxxxxxx>
Date: Sun, 20 Feb 2005 18:53:36 +0100
Hi,

Could someone please consider this patch? I've got a couple of them waiting for it.

Regards,

  Francisco

-----Original Message-----
From: ethereal-dev-bounces@xxxxxxxxxxxx
[mailto:ethereal-dev-bounces@xxxxxxxxxxxx]On Behalf Of Francisco Alcoba
(TS/EEM)
Sent: viernes, 11 de febrero de 2005 9:02
To: ethereal-dev@xxxxxxxxxxxx
Subject: [Ethereal-dev] [Patch] Change of behaviour in get_addr_name


Hi,

I've changed the behaviour of get_addr_name as explained in:

  http://www.ethereal.com/lists/ethereal-dev/200502/msg00118.html

that is:

> - resolve to a name if the address supports it
> - call address_to_str if it does not, but the address is valid
> - return "NONE" if it is AT_NONE

so that it does not crash if called with an AT_NONE as an argument, and
can be used directly even though the address is not solvable to a name.

I've put an internal solve_address_to_name that works as get_addr_name
previously did, and an external get_addr_name_buf that takes an input
and a size.

I have not made get_addr_name_buf call directly to address_to_str_buf, as proposed in the
e-mail above, because the latter does not accept a size as input, so it might end 
up writing in the buffer more characters that it accepts. Changing address_to_str_buf 
to accept a size, which is proposed in a comment in column_utils.c, would imply further 
changes to called functions, unless I use a local buffer and strncpy to it, which somehow 
defeats the purpose.

I've changed conversations_table, hostlist_table and column_utils accordingly.

Regards,

  Francisco


Attachment: get_addr_name.patch
Description: Binary data