#define BUG_ADDRESS "nettle-bugs@lists.lysator.liu.se"
+static void *
+xalloc(size_t size)
+{
+ void *p = malloc(size);
+ if (!p)
+ {
+ fprintf(stderr, "Virtual memory exhausted.\n");
+ abort();
+ }
+
+ return p;
+}
+
\f
/* Conversion functions. */
struct sexp_parser parser;
struct sexp_compound_token token;
struct sexp_output output;
-
+
parse_options(&options, argc, argv);
sexp_input_init(&input, stdin);
options.width, options.prefer_hex);
if (options.hash)
- sexp_output_hash_init(&output,
- options.hash,
- alloca(options.hash->context_size));
+ {
+ /* Leaks the context, but that doesn't matter */
+ void *ctx = xalloc(options.hash->context_size);
+ sexp_output_hash_init(&output, options.hash, ctx);
+ }
sexp_get_char(&input);