Commit f281ca9c authored by Niels Möller's avatar Niels Möller

(read_file): Display a message if fopen fails.

Rev: src/nettle/examples/io.c:1.8
parent 7a7fd9b9
......@@ -30,6 +30,10 @@
#include <stdarg.h>
#include <stdlib.h>
/* For errno and strerror */
#include <errno.h>
#include <string.h>
#include "io.h"
#define RANDOM_DEVICE "/dev/urandom"
......@@ -74,8 +78,10 @@ read_file(const char *name, unsigned max_size, char **contents)
f = fopen(name, "rb");
if (!f)
return 0;
{
werror("Opening `%s' falied: %s\n", name, strerror(errno));
return 0;
}
buffer = NULL;
if (max_size && max_size < 100)
......
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