]> git.ipfire.org Git - thirdparty/strongswan.git/blob - scripts/bin2sql.c
added helper scripts to create SQL scripts
[thirdparty/strongswan.git] / scripts / bin2sql.c
1
2 #include <stdio.h>
3
4 /**
5 * convert standard input to SQL hex binary
6 */
7 int main(int argc, char *argv[])
8 {
9 int i, end = 0;
10 unsigned char byte;
11
12 printf("X'");
13 while (1)
14 {
15 if (fread(&byte, 1, 1, stdin) != 1)
16 {
17 end = 1;
18 break;
19 }
20 printf("%02x", (unsigned int)byte);
21 }
22 printf("'\n");
23 return 0;
24 }
25