author | Markus Bröker <mbroeker@largo.dyndns.tv> |
Thu, 16 Apr 2009 12:47:18 +0200 | |
changeset 27 | 81a574d60c15 |
parent 9 | c3fecc82ade6 |
child 32 | 9b56360ec64e |
permissions | -rw-r--r-- |
0 | 1 |
/** |
9
c3fecc82ade6
standard tags for git projects
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
8
diff
changeset
|
2 |
* test/demos/crypt.c |
c3fecc82ade6
standard tags for git projects
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
8
diff
changeset
|
3 |
* Copyright (C) 2008 Markus Broeker |
0 | 4 |
*/ |
5 |
||
6 |
#include <stdio.h> |
|
7 |
#include <stdlib.h> |
|
8 |
#include <string.h> |
|
9 |
||
10 |
int main (int argc, char **argv) |
|
11 |
{ |
|
12 |
char *data; |
|
27
81a574d60c15
typo in min2time format string
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
9
diff
changeset
|
13 |
|
0 | 14 |
int i; |
15 |
||
16 |
if (argc != 2) { |
|
17 |
printf ("Usage: %s <str>\n", argv[0]); |
|
18 |
return EXIT_SUCCESS; |
|
19 |
} |
|
20 |
||
21 |
/* |
|
22 |
* Its already allocated |
|
23 |
*/ |
|
24 |
data = argv[1]; |
|
25 |
||
26 |
for (i = 0; data[i]; i++) |
|
27 |
data[i] = data[i] + 1; |
|
28 |
||
29 |
printf ("EnCrypted Data: %s\n", data); |
|
30 |
||
31 |
for (i = 0; data[i]; i++) |
|
32 |
data[i] = data[i] - 1; |
|
33 |
||
34 |
printf ("DeCrypted Data: %s\n", data); |
|
35 |
||
8
96d16dfe787a
We use return EXIT_SUCCESS instead of return 0
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
0
diff
changeset
|
36 |
return EXIT_SUCCESS; |
0 | 37 |
} |