From 37bc50d90551a2580f7762d8527e76663fddab20 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 11 Oct 2016 10:10:39 +0200 Subject: add comment about ctime stuff --- pacredir.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pacredir.c b/pacredir.c index 2dabcb7..0241586 100644 --- a/pacredir.c +++ b/pacredir.c @@ -422,13 +422,16 @@ static int ahc_echo(void * cls, request = requests[i]; + /* write the time to buffer ctime, then strip the line break */ ctime_r(&request->last_modified, ctime); - ctime[strlen(ctime) - 1] = 0; + ctime[strlen(ctime) - 1] = '\0'; if (request->http_code == MHD_HTTP_OK) - write_log(stdout, "Found: %s (%f sec, modified: %s)\n", request->url, request->time_total, ctime); + write_log(stdout, "Found: %s (%f sec, modified: %s)\n", + request->url, request->time_total, ctime); else if (verbose > 0 && request->http_code > 0) - write_log(stderr, "Received HTTP status code %d for %s\n", request->http_code, request->url); + write_log(stderr, "Received HTTP status code %d for %s\n", + request->http_code, request->url); if (request->http_code == MHD_HTTP_OK && /* for db files choose the most recent server */ -- cgit v1.2.3-70-g09d2