Changeset 9e56602 in mod_gnutls for test


Ignore:
Timestamp:
May 27, 2016, 8:12:59 PM (3 years ago)
Author:
Thomas Klute <thomas2.klute@…>
Branches:
debian/master, debian/stretch-backports, jessie-backports, master, 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)
Message:

Check for write errors in pgpcrc.c to get rid of build warning

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/pgpcrc.c

    r42829ae r9e56602  
    11#include <unistd.h>
    22#include <arpa/inet.h>
     3#include <stdio.h>
     4#include <errno.h>
    35
    46/* from RFC 4880 section 6.1 */
     
    3032    unsigned char indata[100000];
    3133    ssize_t rr = read(0, indata, sizeof(indata));
    32     if (rr <= 0)
     34    if (rr <= 0) {
     35        perror("pgpcrc read");
    3336        return 1;
     37    }
    3438    output = crc_octets(indata, rr);
    3539    for (i = 2; i >= 0; i--) {
    3640        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        }
    3845    }
    3946    return 0;
Note: See TracChangeset for help on using the changeset viewer.