1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-28 17:10:59 +01:00

31650: use zlong for mailcheck parameters to ensure range

This commit is contained in:
Peter Stephenson 2013-08-11 20:19:53 +01:00
parent b9e16ac818
commit 40a881569f
2 changed files with 9 additions and 4 deletions

View file

@ -1289,8 +1289,8 @@ preprompt(void)
static time_t lastperiodic;
time_t currentmailcheck;
LinkNode ln;
int period = getiparam("PERIOD");
int mailcheck = getiparam("MAILCHECK");
zlong period = getiparam("PERIOD");
zlong mailcheck = getiparam("MAILCHECK");
/*
* Handle any pending window size changes before we compute prompts,
@ -1338,7 +1338,7 @@ preprompt(void)
/* If 1) the parameter PERIOD exists, 2) a hook function for *
* "periodic" exists, 3) it's been greater than PERIOD since we *
* executed any such hook, then execute it now. */
if (period && (time(NULL) > lastperiodic + period) &&
if (period && ((zlong)time(NULL) > (zlong)lastperiodic + period) &&
!callhookfunc("periodic", NULL, 1, NULL))
lastperiodic = time(NULL);
if (errflag)
@ -1358,7 +1358,7 @@ preprompt(void)
/* Check mail */
currentmailcheck = time(NULL);
if (mailcheck &&
(int) difftime(currentmailcheck, lastmailcheck) > mailcheck) {
(zlong) difftime(currentmailcheck, lastmailcheck) > mailcheck) {
char *mailfile;
if (mailpath && *mailpath && **mailpath)