From 4773d2cefd5d71d1d9a6adacacdea4b2774e39d4 Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Mon, 12 Oct 2009 16:53:04 +0000 Subject: [PATCH] fix magic search svn: r16298 --- collects/handin-server/main.ss | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/collects/handin-server/main.ss b/collects/handin-server/main.ss index 70662a2e12..1365816a05 100644 --- a/collects/handin-server/main.ss +++ b/collects/handin-server/main.ss @@ -291,8 +291,10 @@ (let ([m (with-input-from-file f (lambda () (read-bytes mlen)))]) (ormap (lambda (magic) - (equal? magic - (subbytes m 0 (bytes-length magic)))) + (and (>= (bytes-length m) (bytes-length magic)) + (equal? magic + (subbytes m 0 + (bytes-length magic))))) magics)) (or (not file) (> (file-or-directory-modify-seconds f) time)))