about summary refs log tree commit diff
path: root/Src/utils.c
diff options
context:
space:
mode:
authorPeter Stephenson <p.w.stephenson@ntlworld.com>2013-08-11 20:19:53 +0100
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2013-08-11 20:19:53 +0100
commit40a881569fed17177fbd73079dd4d3849517567c (patch)
tree9a37d138c270d559fac50949a547307a9835ab71 /Src/utils.c
parentb9e16ac81849a8bf13ca9674606b673733210bf5 (diff)
downloadzsh-40a881569fed17177fbd73079dd4d3849517567c.tar.gz
zsh-40a881569fed17177fbd73079dd4d3849517567c.tar.xz
zsh-40a881569fed17177fbd73079dd4d3849517567c.zip
31650: use zlong for mailcheck parameters to ensure range
Diffstat (limited to 'Src/utils.c')
-rw-r--r--Src/utils.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Src/utils.c b/Src/utils.c
index 6d9ffe350..d1d9406c2 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -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)