Various pages use inconsistent terms for 'null byte' (which
is the C99/SUSv3 term for the '\0' character).
To rectify this the following changes were made in these pages:
Replace 'zero byte' with 'null byte'.
Replace 'null character' with 'null byte'.
Replace 'nulls' with 'null bytes'.
Replace 'NUL-terminated' by 'null-terminated'.
Replace 'NUL' by 'null byte'.
Replace 'terminating NUL' by 'terminating null byte'.
Replace 'final NUL' by 'terminating null byte'.
Replace 'NUL character' by 'null byte'.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=205736
[[
This example contains the following line:
if ((p = realloc (p, size)) == NULL)
return NULL;
This is a very ill written code, since realloc returning
NULL do not deallocate the original memory block. Such a
statement has a potential to become significant memory
hole. I suggest to correct this example since:
1. It may trick naive programmers to write bad code
2. It may lead skeptic observers to the believe
the whole Linux is written in a similar style.
Regards Jan Kuznik
]]
This guy is right on the money!
I've changed that example, so that the above code has been replaced by:
char *np;
...
if ((np = realloc (p, size)) == NULL) {
free(p);
return NULL;
} else {
p = np;
}
Cheers,
Michael