On Fri, Nov 21, 2003, Alan DeKok wrote:
>Bill Campbell <[EMAIL PROTECTED]> wrote:
>> >  For uint8_t arrays, The 'sizeof' the array is the number of elements.
>> 
>> OK.  While that may be the case for uint8_t, it seems to me that good
>> coding practice is to use sizeof here and not depend on knowledge of the
>> internal size of the elements.
>
>  The problem is that the fields are defined in relation to the
>protocol: 16 octets.  sizeof() is a C programming construct, and thus
>there may be padding in a struct.  We do not want that padding to
>affect the programs ability to generate or parse 16 octet fields.

Perhaps it would be good to put some comments in radius.c explaining this,
and be consistent in its use.  This could save some head scratching in the
future, particularly if somebody (like me) who's not all that familiar with
the code is looking at it.

Bill
--
INTERNET:   [EMAIL PROTECTED]  Bill Campbell; Celestial Software LLC
UUCP:               camco!bill  PO Box 820; 6641 E. Mercer Way
FAX:            (206) 232-9186  Mercer Island, WA 98040-0820; (206) 236-1676
URL: http://www.celestial.com/

``Never blame a legislative body for not doing something.  When they do
nothing, that don't hurt anybody.  When they do something is when they
become dangerous.''
    Will Rogers

- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Reply via email to