summaryrefslogtreecommitdiffstats
path: root/contrib/ntp/ntpd/ntp_signd.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/ntp/ntpd/ntp_signd.c')
-rw-r--r--contrib/ntp/ntpd/ntp_signd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/contrib/ntp/ntpd/ntp_signd.c b/contrib/ntp/ntpd/ntp_signd.c
index 2ba11d0..857dcbf 100644
--- a/contrib/ntp/ntpd/ntp_signd.c
+++ b/contrib/ntp/ntpd/ntp_signd.c
@@ -66,7 +66,7 @@ write_all(int fd, const void *buf, size_t len)
while (len) {
int n = write(fd, buf, len);
if (n <= 0) return total;
- buf = n + (char *)buf;
+ buf = n + (const char *)buf;
len -= n;
total += n;
}
@@ -110,9 +110,10 @@ recv_packet(int fd, char **buf, uint32_t *len)
{
if (read_all(fd, len, sizeof(*len)) != sizeof(*len)) return -1;
*len = ntohl(*len);
- (*buf) = emalloc(*len);
+ *buf = emalloc(*len);
if (read_all(fd, *buf, *len) != *len) {
free(*buf);
+ *buf = NULL;
return -1;
}
return 0;
OpenPOWER on IntegriCloud