Return values of malloc/strdup/... not checked (was Re: [patch] cdebconf and i18n)
On Tue, Nov 12, 2002 at 02:41:23AM +0900, Junichi Uekawa wrote: Why does it have to be char something[] when char * something will perfectly work ? I did not say it has to be a char[6], I do not care if someone wants to malloc it. Please use strdup and friends, or asprintf, or other kind of things that are less prone to break. Ok, I will use strdup. While we are on it, why are return values of allocation routines never checked? Denis -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: Return values of malloc/strdup/... not checked (was Re: [patch] cdebconf and i18n)
Please use strdup and friends, or asprintf, or other kind of things that are less prone to break. Ok, I will use strdup. While we are on it, why are return values of allocation routines never checked? You could add checks, or use/define xstrdup to give some useful error message. They will cause problem sometime in the future, I suspect, so fixing them whenever you notice would be a good start. regards, junichi -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]