|
From: | zhengda |
Subject: | Re: The patch of glibc which allows the user to override the pfinet server |
Date: | Sun, 17 Aug 2008 13:57:18 +0200 |
User-agent: | Thunderbird 2.0.0.16 (X11/20080707) |
olafBuddenhagen@gmx.net wrote:
My first C language teacher told me to initialize all local variables, especially the pointers,It really depends on the context. In some cases -- if the pointer is dereferenced -- NULL will create an obvious failure, while some random uninitialized pointer might be harder to track down. In other cases -- if it's used as argument to realloc(), free() etc.; or if it's tested as a result from some other operation (getenv() in this case) -- NULL will be treated as perfectly valid, and not give any indication of failure at all! Thus I don't think it's good practice in general to initialize all pointers to NULL...
I follow the rule, and sometimes it does give me some help:-)
Again it's the problem of my mail client. My mail client always replace a tab with 4 spaces.+ if (__asprintf (&name, "SOCK_SERV_%d", domain) < 0) + __libc_fatal ("hurd: Can't get the socket server path\n");What happened to indentation here?!
I guess it's better for me to send the patch in the attachment. Zheng Da
[Prev in Thread] | Current Thread | [Next in Thread] |