[PATCH] Make the git-fsck-objects diagnostics more useful
[git.git] / mailsplit.c
index 9379fbc..a3238c2 100644 (file)
@@ -77,7 +77,7 @@ static int parse_email(const void *map, unsigned long size)
 
        /*
         * Search for a line beginning with "From ", and 
-        * having smething that looks like a date format.
+        * having something that looks like a date format.
         */
        do {
                int len = linelen(map, size);
@@ -116,8 +116,9 @@ int main(int argc, char **argv)
        }
        size = st.st_size;
        map = mmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0);
-       if (-1 == (int)(long)map) {
+       if (map == MAP_FAILED) {
                perror("mmap");
+               close(fd);
                exit(1);
        }
        close(fd);