Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dmitry Baryshkov
nettle
Commits
f281ca9c
Commit
f281ca9c
authored
Mar 18, 2004
by
Niels Möller
Browse files
(read_file): Display a message if fopen fails.
Rev: src/nettle/examples/io.c:1.8
parent
7a7fd9b9
Changes
1
Hide whitespace changes
Inline
Side-by-side
examples/io.c
View file @
f281ca9c
...
...
@@ -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
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment