Changeset 9e56602 in mod_gnutls
- Timestamp:
- May 27, 2016, 8:12:59 PM (6 years ago)
- Branches:
- asyncio, debian/master, debian/stretch-backports, jessie-backports, master, proxy-ticket, upstream
- Children:
- 2b80754
- Parents:
- 42829ae
- git-author:
- Thomas Klute <thomas2.klute@…> (05/27/16 18:32:49)
- git-committer:
- Thomas Klute <thomas2.klute@…> (05/27/16 20:12:59)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/pgpcrc.c
r42829ae r9e56602 1 1 #include <unistd.h> 2 2 #include <arpa/inet.h> 3 #include <stdio.h> 4 #include <errno.h> 3 5 4 6 /* from RFC 4880 section 6.1 */ … … 30 32 unsigned char indata[100000]; 31 33 ssize_t rr = read(0, indata, sizeof(indata)); 32 if (rr <= 0) 34 if (rr <= 0) { 35 perror("pgpcrc read"); 33 36 return 1; 37 } 34 38 output = crc_octets(indata, rr); 35 39 for (i = 2; i >= 0; i--) { 36 40 o = ((output >> (8 * i)) & 0xff); 37 write(1, &o, sizeof(o)); 41 if (write(1, &o, sizeof(o)) < 0) { 42 perror("pgpcrc write"); 43 return 2; 44 } 38 45 } 39 46 return 0;
Note: See TracChangeset
for help on using the changeset viewer.