From: Tobias Brunner Date: Tue, 1 Jul 2014 10:13:13 +0000 (+0200) Subject: swid: fgets(3) returns a pointer to the read string or NULL X-Git-Tag: 5.2.0~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f82d7aff85c5d8a2bd890424e9e5e5a2f2a39572;p=thirdparty%2Fstrongswan.git swid: fgets(3) returns a pointer to the read string or NULL --- diff --git a/src/libpts/swid/swid_inventory.c b/src/libpts/swid/swid_inventory.c index e050e61298..a9f081efa5 100644 --- a/src/libpts/swid/swid_inventory.c +++ b/src/libpts/swid/swid_inventory.c @@ -71,7 +71,7 @@ static status_t read_swid_tags(private_swid_inventory_t *this, FILE *file) writer = bio_writer_create(512); do { - if (fgets(line, sizeof(line), file) <= 0) + if (!fgets(line, sizeof(line), file)) { more_tags = FALSE; end_of_tag = TRUE; @@ -126,7 +126,7 @@ static status_t read_swid_tag_ids(private_swid_inventory_t *this, FILE *file) char *separator; size_t len; - if (fgets(line, sizeof(line), file) <= 0) + if (!fgets(line, sizeof(line), file)) { return SUCCESS; } @@ -201,7 +201,7 @@ static status_t generate_tags(private_swid_inventory_t *this, char *generator, { swid_tag_id_t *tag_id; enumerator_t *enumerator; - + enumerator = targets->create_enumerator(targets); while (enumerator->enumerate(enumerator, &tag_id)) {