Jim Meyering wrote:
> Also, you've made it so upon failure it gives an
> inferior diagnostic, using perror, rather than "error".

Yes, the error message "<progname>: memory exhausted" is more understandable
for an end user than "realloc: Cannot allocate memory". End users don't
even know what 'realloc' is.

Additionally, it bypasses xalloc_die() and uses exit(1). But in GNU diff,
trouble like memory allocation failures must yield an exit code of 2, not 1.

Robert Millan wrote:
> > This makes it easier to import xgethostname.c into an external program.

You know that you are free to keep modified copies of gnulib code?
gnulib-tool explicitly supports this through its --local-dir option.
I did that for xmalloc.c for some time, until I realized that the one
in gnulib is really the best you can get.

Bruno


Reply via email to