summaryrefslogtreecommitdiff
path: root/legacy/eet/src/examples/eet-data-cipher_decipher.c
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2011-10-21 05:40:01 +0000
committerCarsten Haitzler <raster@rasterman.com>2011-10-21 05:40:01 +0000
commit8893a9ff35f58e012be3cc838bd94268add13e10 (patch)
treee5c560542a70ccf657e1da45fb57d8dee99d3348 /legacy/eet/src/examples/eet-data-cipher_decipher.c
parenta331fe3bca4816e3a45662afd986e364b3586eed (diff)
ran ecrustify on eet. this seems to do a good job of eet. comments?
SVN revision: 64237
Diffstat (limited to 'legacy/eet/src/examples/eet-data-cipher_decipher.c')
-rw-r--r--legacy/eet/src/examples/eet-data-cipher_decipher.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/legacy/eet/src/examples/eet-data-cipher_decipher.c b/legacy/eet/src/examples/eet-data-cipher_decipher.c
index 1688e020a4..2ef965c745 100644
--- a/legacy/eet/src/examples/eet-data-cipher_decipher.c
+++ b/legacy/eet/src/examples/eet-data-cipher_decipher.c
@@ -27,7 +27,7 @@ main(void)
27 if (!(file = tmpnam(file))) 27 if (!(file = tmpnam(file)))
28 { 28 {
29 fprintf( 29 fprintf(
30 stderr, "ERROR: could not create temporary file (%s).\n", file); 30 stderr, "ERROR: could not create temporary file (%s).\n", file);
31 goto panic; 31 goto panic;
32 } 32 }
33 33
@@ -36,14 +36,14 @@ main(void)
36 if (!ef) 36 if (!ef)
37 { 37 {
38 fprintf( 38 fprintf(
39 stderr, "ERROR: could not access file (%s).\n", file); 39 stderr, "ERROR: could not access file (%s).\n", file);
40 goto error; 40 goto error;
41 } 41 }
42 42
43 if (!eet_write_cipher(ef, "keys/tests", buffer, strlen(buffer) + 1, 0, key)) 43 if (!eet_write_cipher(ef, "keys/tests", buffer, strlen(buffer) + 1, 0, key))
44 { 44 {
45 fprintf( 45 fprintf(
46 stderr, "ERROR: could not access file (%s).\n", file); 46 stderr, "ERROR: could not access file (%s).\n", file);
47 goto error; 47 goto error;
48 } 48 }
49 49
@@ -54,7 +54,7 @@ main(void)
54 if (!ef) 54 if (!ef)
55 { 55 {
56 fprintf( 56 fprintf(
57 stderr, "ERROR: could not access file (%s).\n", file); 57 stderr, "ERROR: could not access file (%s).\n", file);
58 goto error; 58 goto error;
59 } 59 }
60 60
@@ -62,22 +62,22 @@ main(void)
62 if (!test) 62 if (!test)
63 { 63 {
64 fprintf( 64 fprintf(
65 stderr, "ERROR: could decript contents on file %s, with key %s.\n", 65 stderr, "ERROR: could decript contents on file %s, with key %s.\n",
66 file, key); 66 file, key);
67 goto error; 67 goto error;
68 } 68 }
69 69
70 if (size != (int)strlen(buffer) + 1) 70 if (size != (int)strlen(buffer) + 1)
71 { 71 {
72 fprintf( 72 fprintf(
73 stderr, "ERROR: something is wrong with the decripted data\n"); 73 stderr, "ERROR: something is wrong with the decripted data\n");
74 goto error; 74 goto error;
75 } 75 }
76 76
77 if (memcmp(test, buffer, strlen(buffer) + 1) != 0) 77 if (memcmp(test, buffer, strlen(buffer) + 1) != 0)
78 { 78 {
79 fprintf( 79 fprintf(
80 stderr, "ERROR: something is wrong with the decripted data\n"); 80 stderr, "ERROR: something is wrong with the decripted data\n");
81 goto error; 81 goto error;
82 } 82 }
83 83
@@ -88,7 +88,7 @@ main(void)
88 if (!ef) 88 if (!ef)
89 { 89 {
90 fprintf( 90 fprintf(
91 stderr, "ERROR: could not access file (%s).\n", file); 91 stderr, "ERROR: could not access file (%s).\n", file);
92 goto error; 92 goto error;
93 } 93 }
94 94
@@ -96,24 +96,24 @@ main(void)
96 96
97 if (size == (int)strlen(buffer) + 1) 97 if (size == (int)strlen(buffer) + 1)
98 if (memcmp(test, buffer, strlen(buffer) + 1) == 0) 98 if (memcmp(test, buffer, strlen(buffer) + 1) == 0)
99 { 99 {
100 fprintf( 100 fprintf(
101 stderr, "ERROR: something is wrong with the contents of %s, as" 101 stderr, "ERROR: something is wrong with the contents of %s, as"
102 " we accessed it with a different key and it decripted our" 102 " we accessed it with a different key and it decripted our"
103 " information right.\n", file); 103 " information right.\n", file);
104 goto error; 104 goto error;
105 } 105 }
106 106
107 eet_close(ef); 107 eet_close(ef);
108 108
109 error: 109error:
110 if (unlink(file) != 0) 110 if (unlink(file) != 0)
111 { 111 {
112 fprintf( 112 fprintf(
113 stderr, "ERROR: could not unlink file (%s).\n", file); 113 stderr, "ERROR: could not unlink file (%s).\n", file);
114 } 114 }
115 115
116 panic: 116panic:
117 eet_shutdown(); 117 eet_shutdown();
118} 118}
119 119