summaryrefslogtreecommitdiff
path: root/src/examples/eet/eet-data-cipher_decipher.c
diff options
context:
space:
mode:
authorSavio Sena <savio@expertisesolutions.com.br>2014-05-24 02:27:11 +0200
committerCedric Bail <cedric.bail@free.fr>2014-05-24 02:27:15 +0200
commit72ee78b929d6af5436d09eee1a5ef41719b5f918 (patch)
tree187c336777624af8194778959beb7ff3a65e0cbb /src/examples/eet/eet-data-cipher_decipher.c
parente68225ae691bfa5d8df694fc1f4bd96f1fee9003 (diff)
efl: remove some warnings.
Summary: Mainly from the examples but also from libunibreak and tests/eet. I'm not sure if it's really worth to remove warnings from the examples -- because it adds pedantic-ness to something supposed to be didatic, but I leave for you guys to judge. Reviewers: tasn, cedric CC: felipealmeida, raster, smohanty, cedric Differential Revision: https://phab.enlightenment.org/D896 Signed-off-by: Cedric Bail <cedric.bail@free.fr>
Diffstat (limited to 'src/examples/eet/eet-data-cipher_decipher.c')
-rw-r--r--src/examples/eet/eet-data-cipher_decipher.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/examples/eet/eet-data-cipher_decipher.c b/src/examples/eet/eet-data-cipher_decipher.c
index 1708b78144..4ff94d5782 100644
--- a/src/examples/eet/eet-data-cipher_decipher.c
+++ b/src/examples/eet/eet-data-cipher_decipher.c
@@ -8,6 +8,7 @@
8#include <sys/types.h> 8#include <sys/types.h>
9#include <sys/stat.h> 9#include <sys/stat.h>
10#include <unistd.h> 10#include <unistd.h>
11#include <string.h>
11 12
12int 13int
13main(void) 14main(void)
@@ -16,17 +17,19 @@ main(void)
16 const char *key = "This is a crypto key"; 17 const char *key = "This is a crypto key";
17 const char *key_bad = "This is another crypto key"; 18 const char *key_bad = "This is another crypto key";
18 19
19 char *file = strdup("/tmp/eet_cipher_example_XXXXX"); 20 char *file = strdup("/tmp/eet_cipher_example_XXXXXX");
20 Eet_File *ef; 21 Eet_File *ef;
21 char *test; 22 char *test;
22 int size; 23 int size;
24 int tmpfd;
23 25
24 eet_init(); 26 eet_init();
25 27
26 if (!(file = tmpnam(file))) 28 if (-1 == (tmpfd = mkstemp(file)) || !!close(tmpfd))
27 { 29 {
28 fprintf( 30 fprintf(
29 stderr, "ERROR: could not create temporary file (%s).\n", file); 31 stderr, "ERROR: could not create temporary file (%s) : %s\n",
32 file, strerror(errno));
30 goto panic; 33 goto panic;
31 } 34 }
32 35