monitor - Fix wrong memory access attempt.
authorAntonio Huete Jimenez <tuxillo@quantumachine.net>
Sun, 22 Aug 2010 14:22:13 +0000 (16:22 +0200)
committerAntonio Huete Jimenez <tuxillo@quantumachine.net>
Sun, 22 Aug 2010 14:22:13 +0000 (16:22 +0200)
usr.bin/monitor/monitor.c

index e2b1f8b..630c26a 100644 (file)
@@ -141,7 +141,7 @@ monitor_add(const char *path)
        if (elm->fd >= NumFiles) {
                MaxFiles = (elm->fd + 16) * 3 / 2;
                Elms = realloc(Elms, MaxFiles * sizeof(elm));
-               bzero(&Elms[NumFiles], (NumFiles - MaxFiles) * sizeof(elm));
+               bzero(&Elms[NumFiles], (MaxFiles - NumFiles) * sizeof(elm));
                NumFiles = MaxFiles;
        }
        Elms[elm->fd] = elm;