]> granicus.if.org Git - cronie/commitdiff
strncmp() size fixes.
authorVille Skytta <ville.skytta@iki.fi>
Wed, 18 Dec 2013 15:14:54 +0000 (16:14 +0100)
committerMarcela Mašláňová <mmaslano@redhat.com>
Wed, 18 Dec 2013 15:14:54 +0000 (16:14 +0100)
Signed-off-by: Marcela Mašláňová <mmaslano@redhat.com>
anacron/readtab.c
src/do_command.c

index d5c3c7ca6c3a08c58eddff551c2192e2b0cc603a..1b68cab6e3c92b3919b3b554ce02ba3a499a1150 100644 (file)
@@ -208,11 +208,11 @@ register_period_job(const char *periods, const char *delays,
     }
 
     jr = obstack_alloc(&tab_o, sizeof(job_rec));
-    if (!strncmp ("@monthly", periods, 7)) {
+    if (!strncmp ("@monthly", periods, 8)) {
                jr->named_period = 1;
     } else if (!strncmp("@yearly", periods, 7) || !strncmp("@annualy", periods, 8)) {
                jr->named_period = 2;
-       } else if (!strncmp ("@daily", periods, 7)) {
+       } else if (!strncmp ("@daily", periods, 6)) {
                jr->named_period = 3;
        } else if (!strncmp ("@weekly", periods, 7)) {
                jr->named_period = 4;
index 1239686ea14ab02f1dc5894657ac3b25f1543a35..4ed6bb6178c9771af8c4d77037f61d4e66a8836b 100644 (file)
@@ -410,7 +410,7 @@ static int child_process(entry * e, char **jobenv) {
 
                        /* Also skip it if MailCmd is set to "off" */
                        if (mailto && safe_p(usernm, mailto)
-                               && strncmp(MailCmd,"off",4) && !SyslogOutput) {
+                               && strncmp(MailCmd,"off",3) && !SyslogOutput) {
                                char **env;
                                char mailcmd[MAX_COMMAND];
                                char hostname[MAXHOSTNAMELEN];