git-checkout: fix branch name output from the command
[gitweb.git] / test-delta.c
index cc05794ec0b69aa2a05f7d02a412e18c87687047..795aa08377aaa9a229affaa054e243251436f755 100644 (file)
@@ -8,13 +8,7 @@
  * published by the Free Software Foundation.
  */
 
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
+#include "git-compat-util.h"
 #include "delta.h"
 
 static const char usage[] =
@@ -38,10 +32,7 @@ int main(int argc, char *argv[])
                return 1;
        }
        from_size = st.st_size;
-       if (from_size)
-               from_buf = mmap(NULL, from_size, PROT_READ, MAP_PRIVATE, fd, 0);
-       else
-               from_buf = "";
+       from_buf = mmap(NULL, from_size, PROT_READ, MAP_PRIVATE, fd, 0);
        if (from_buf == MAP_FAILED) {
                perror(argv[2]);
                close(fd);
@@ -55,11 +46,7 @@ int main(int argc, char *argv[])
                return 1;
        }
        data_size = st.st_size;
-
-       if (data_size)
-               data_buf = mmap(NULL, data_size, PROT_READ, MAP_PRIVATE, fd, 0);
-       else
-               data_buf = "";
+       data_buf = mmap(NULL, data_size, PROT_READ, MAP_PRIVATE, fd, 0);
        if (data_buf == MAP_FAILED) {
                perror(argv[3]);
                close(fd);