Skip to content
Snippets Groups Projects
Commit 9fe539d0 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(checkstatus): Use sizeof(lbuf) instead of 80.

parent e0051fc7
No related branches found
No related tags found
No related merge requests found
/* /*
* $Id: updateLysKOM.c,v 1.13 1999/05/24 09:34:43 ceder Exp $ * $Id: updateLysKOM.c,v 1.14 2001/09/22 16:57:33 ceder Exp $
* Copyright (C) 1994-1995, 1998-1999 Lysator Academic Computer Association. * Copyright (C) 1994-1995, 1998-1999 Lysator Academic Computer Association.
* *
* This file is part of the LysKOM server. * This file is part of the LysKOM server.
...@@ -118,10 +118,10 @@ checkstatus(FILE *fp, ...@@ -118,10 +118,10 @@ checkstatus(FILE *fp,
else if (ldifftime(time(NULL), sbuf.st_mtime) else if (ldifftime(time(NULL), sbuf.st_mtime)
< 60 * param.downtime_mail_end) < 60 * param.downtime_mail_end)
{ {
/* The first line of the file should be a mail addres to send /* The first line of the file should be a mail address to send
a reminder to. */ a reminder to. */
if (fgets(lbuf, 80, fp) == NULL) if (fgets(lbuf, sizeof(lbuf), fp) == NULL)
{ {
fprintf(stderr, fprintf(stderr,
"updateLysKOM: LysKOM has been down for a short while\n"); "updateLysKOM: LysKOM has been down for a short while\n");
...@@ -129,6 +129,7 @@ checkstatus(FILE *fp, ...@@ -129,6 +129,7 @@ checkstatus(FILE *fp,
} }
if (strchr(lbuf, '\n')) if (strchr(lbuf, '\n'))
*strchr(lbuf, '\n') = '\0'; *strchr(lbuf, '\n') = '\0';
/* FIXME: "Reminder:" is taken to be an email address. */
sprintf(buf2, "echo 'Reminder: LysKOM is still not running.'|mail %s", sprintf(buf2, "echo 'Reminder: LysKOM is still not running.'|mail %s",
lbuf); lbuf);
if (system(buf2) != 0) if (system(buf2) != 0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment