Commit f5afd83f authored by Russ Allbery's avatar Russ Allbery

Report the allocation limit on xmalloc failure

parent 501cc49d
......@@ -5,7 +5,7 @@
* which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
*
* Copyright 2000, 2001, 2006 Russ Allbery <rra@stanford.edu>
* Copyright 2008
* Copyright 2008, 2012
* The Board of Trustees of the Leland Stanford Junior University
*
* Permission is hereby granted, free of charge, to any person obtaining a
......@@ -321,8 +321,8 @@ main(int argc, char *argv[])
if (size < limit || code == 'r') {
tmp = malloc(code == 'r' ? 10 : size);
if (tmp == NULL) {
syswarn("Can't allocate initial memory of %lu",
(unsigned long) size);
syswarn("Can't allocate initial memory of %lu (limit %lu)",
(unsigned long) size, (unsigned long) limit);
exit(2);
}
free(tmp);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment