X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=mailsplit.c;h=a3238c20da27c3348d406066b595cd085e600558;hb=f1f0d0889e5557bc467490fdbd53f7b912503a33;hp=9379fbc5e84983e5ea0754a6587cc3490c696c69;hpb=2744b2344dc42fa2a1ddf17f4818975cd48f6d42;p=git.git diff --git a/mailsplit.c b/mailsplit.c index 9379fbc5..a3238c20 100644 --- a/mailsplit.c +++ b/mailsplit.c @@ -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);