Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame^] | 1 | From 6c8fe883df993b9e7987c8f1c849962f8007a373 Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Mon, 29 Aug 2022 12:50:37 -0700 |
| 4 | Subject: [PATCH] ez-ipupdate: Include time.h for time() API prototype |
| 5 | |
| 6 | Fix printf format specifiers for snprintf |
| 7 | |
| 8 | Upstream-Status: Pending |
| 9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 10 | --- |
| 11 | ez-ipupdate.c | 6 ++++-- |
| 12 | 1 file changed, 4 insertions(+), 2 deletions(-) |
| 13 | |
| 14 | diff --git a/ez-ipupdate.c b/ez-ipupdate.c |
| 15 | index 15a4c13..5cbe7f3 100644 |
| 16 | --- a/ez-ipupdate.c |
| 17 | +++ b/ez-ipupdate.c |
| 18 | @@ -38,6 +38,8 @@ |
| 19 | # include <config.h> |
| 20 | #endif |
| 21 | |
| 22 | +#include <time.h> |
| 23 | + |
| 24 | // you man very well need to edit this, don't worry though, email is only sent |
| 25 | // if bad things happend and it has to exit when in daemon mode. |
| 26 | #define SEND_EMAIL_CMD "mail" |
| 27 | @@ -2483,7 +2485,7 @@ int DHS_update_entry(void) |
| 28 | p += strlen(p); |
| 29 | limit = BUFFER_SIZE - 1 - strlen(buf); |
| 30 | |
| 31 | - snprintf(buf, BUFFER_SIZE, "Content-length: %d\015\012", strlen(putbuf)); |
| 32 | + snprintf(buf, BUFFER_SIZE, "Content-length: %lu\015\012", strlen(putbuf)); |
| 33 | output(buf); |
| 34 | snprintf(buf, BUFFER_SIZE, "\015\012"); |
| 35 | output(buf); |
| 36 | @@ -2620,7 +2622,7 @@ int DHS_update_entry(void) |
| 37 | p += strlen(p); |
| 38 | limit = BUFFER_SIZE - 1 - strlen(buf); |
| 39 | |
| 40 | - snprintf(buf, BUFFER_SIZE, "Content-length: %d\015\012", strlen(putbuf)); |
| 41 | + snprintf(buf, BUFFER_SIZE, "Content-length: %lu\015\012", strlen(putbuf)); |
| 42 | output(buf); |
| 43 | snprintf(buf, BUFFER_SIZE, "\015\012"); |
| 44 | output(buf); |