
21 Oct
2010
21 Oct
'10
1:45 p.m.
Wolfgang Denk wd@denx.de wrote on 2010/10/21 13:32:54:
Dear Joakim Tjernlund,
In message <OF9263CF56.48468959-ONC12577C3.003E4D93-C12577C3. 003ECAD7@transmode.se> you wrote:
- if ((long)bytes < 0) return 0;
- if ((long)bytes <= 0) return 0;
I think you should return some impossible ptr value =! NULL Size 0 not really an error.
It is legal for malloc() to return NULL in case of size==0, and for the sake of simplicity I recommend we do just that.
Yes, but not very useful. Glibc does not return NULL