1
0
Fork 0
mirror of https://passt.top/passt synced 2025-05-21 08:45:36 +02:00

lineread: Use ssize_t for line lengths

Functions and structures in lineread.c use plain int to record and report
the length of lines we receive.  This means we truncate the result from
read(2) in some circumstances.  Use ssize_t to avoid that.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
David Gibson 2024-06-06 20:09:48 +10:00 committed by Stefano Brivio
parent c919bbbdd3
commit f9e8ee0777
3 changed files with 9 additions and 10 deletions

2
conf.c
View file

@ -401,9 +401,9 @@ static void get_dns(struct ctx *c)
struct fqdn *s = c->dns_search;
struct lineread resolvconf;
unsigned int added = 0;
ssize_t line_len;
char *line, *end;
const char *p;
int line_len;
dns4_set = !c->ifi4 || !IN4_IS_ADDR_UNSPECIFIED(dns4);
dns6_set = !c->ifi6 || !IN6_IS_ADDR_UNSPECIFIED(dns6);