
6 Jan
2012
6 Jan
'12
7:51 a.m.
On Thursday 05 January 2012 18:25:06 Wolfgang Denk wrote:
Mike Frysinger wrote:
- if ((s == NULL) ||
((new = malloc (len + 1)) == NULL) ) {
return NULL;
- }
please split this up such as:
I'm OK with the splitting, but...
if (s == NULL) return s;
new = malloc(len + 1); if (new == NULL) return new;
... in both cases, a "return NULL" is much easier to parse for the human and identical for the compiler, so that should be used.
sure, np -mike