[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Hint for a port of a package



> -  syslog(LOG_WARNING, "cmd_q(): malloc(%d) returned NULL",
> sizeof(struct ordq_item_t));
> +  syslog(LOG_WARNING, "cmd_q(): malloc(%d) returned NULL", (int)
> sizeof(struct ordq_item_t));

this is ok, but better would be:
syslog(LOG_WARNING, "cmd_q(): malloc(%ld) returned NULL", sizeof(struct ordq_item_t));

> - if ( list_find(&ackq, (int)who) == NULL ) return(cmd_send(item));
> + if ( list_find(&ackq, (int) sizeof(who)) == NULL )
> return(cmd_send(item));

this looks wrong...
you should probably change the list_find function to either use void*
for at least a long type as the id

> sizeof(struct ackq_item_t));
> +  syslog(LOG_WARNING, "ack_q(): malloc(%d) returned NULL", (int)
> sizeof(struct ackq_item_t));

ditto as above.
randolph
-- 
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/

Attachment: pgpviJB8jxq0v.pgp
Description: PGP signature


Reply to: