Skip to content
Snippets Groups Projects
Commit a45c20c8 authored by Niels Möller's avatar Niels Möller
Browse files

(xalloc): New function.

Rev: src/nettle/examples/io.c:1.7
Rev: src/nettle/examples/io.h:1.4
parent 783474cf
No related branches found
No related tags found
No related merge requests found
......@@ -37,6 +37,19 @@
int quiet_flag = 0;
void *
xalloc(size_t size)
{
void *p = malloc(size);
if (!p)
{
fprintf(stderr, "Virtual memory exhausted.\n");
abort();
}
return p;
}
void
werror(const char *format, ...)
{
......
......@@ -34,6 +34,9 @@
extern int quiet_flag;
void *
xalloc(size_t size);
void
werror(const char *format, ...)
#if __GNUC___
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment