[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: commit: ldap/servers/slapd/overlays auditlog.c



Rein Tollevik wrote:

On a slightly related note, but I only noticed because it's near the patched lines - if sizeof(time_t) != sizeof(long) then the fprintf argument is going to break. I think you should simply keep stamp declared as long and let the compiler promote the return value from slap_get_time() if it needs to.

Yes, that is a potential problem that should be fixed. Although I would prefer it as an explicit cast, as that imho must better tells the random reader that the programmer har thought about it. I.e, to keep stamp as a long variable and cast the slap_get_time() return value, or as I would prefer it to cast the stamp argument in the fprintf statements.

I've fixed it the other way. I prefer to use types as they should, and only cast them for printing reasons, to make clear where the "hack" is. In this case, the sole purpose was printing it, so it would have been fine the other way 'round as well, though.


p.



Ing. Pierangelo Masarati
OpenLDAP Core Team

SysNet s.r.l.
via Dossi, 8 - 27100 Pavia - ITALIA
http://www.sys-net.it
---------------------------------------
Office:  +39 02 23998309
Mobile:  +39 333 4963172
Email:   pierangelo.masarati@sys-net.it
---------------------------------------