Changeset 331
- Timestamp:
- 01/10/06 17:24:13
- Files:
-
- openpgpsdk/trunk/examples/packet-dump.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
openpgpsdk/trunk/examples/packet-dump.c
r327 r331 13 13 #include <stdlib.h> 14 14 #include <string.h> 15 #include <fcntl.h> 15 16 16 17 static int indent=0; … … 868 869 static void usage() 869 870 { 870 fprintf(stderr,"%s [-a]\n",pname); 871 fprintf(stderr,"%s [-a] [-b] <file name>\n\n",pname); 872 fprintf(stderr,"-a\tRead armoured data\n" 873 "-b\tDon't buffer stdout/stderr\n"); 871 874 exit(1); 872 875 } … … 878 881 int ret; 879 882 int ch; 883 int fd; 880 884 881 885 pname=argv[0]; … … 896 900 usage(); 897 901 } 898 902 argc-=optind; 903 argv+=optind; 904 905 if(argc != 1) 906 usage(); 907 908 fd=open(argv[0],O_RDONLY); 909 if(fd < 0) 910 { 911 perror(argv[0]); 912 exit(2); 913 } 899 914 900 915 pinfo=ops_parse_info_new(); … … 904 919 ops_parse_cb_set(pinfo,callback,NULL); 905 920 906 ops_reader_set_fd(pinfo, 0);921 ops_reader_set_fd(pinfo,fd); 907 922 908 923 if(armour)
