]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - tools/mkenvimage.c
Merge branch 'master' of git://git.denx.de/u-boot-x86
[karo-tx-uboot.git] / tools / mkenvimage.c
index 9dbb3b210b4b4bcccbcb713cfa2bad8020a33349..55212687e17d0162790002c1c3e5fffbfccb45ca 100644 (file)
@@ -35,6 +35,7 @@
 #include <stdint.h>
 #include <string.h>
 #include <unistd.h>
+#include <libgen.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/mman.h>
@@ -213,7 +214,7 @@ int main(int argc, char **argv)
                filebuf = mmap(NULL, sizeof(*envptr) * filesize, PROT_READ,
                               MAP_PRIVATE, txt_fd, 0);
                if (filebuf == MAP_FAILED) {
-                       fprintf(stderr, "mmap (%ld bytes) failed: %s\n",
+                       fprintf(stderr, "mmap (%zu bytes) failed: %s\n",
                                        sizeof(*envptr) * filesize,
                                        strerror(errno));
                        fprintf(stderr, "Falling back to read()\n");
@@ -221,7 +222,7 @@ int main(int argc, char **argv)
                        filebuf = malloc(sizeof(*envptr) * filesize);
                        ret = read(txt_fd, filebuf, sizeof(*envptr) * filesize);
                        if (ret != sizeof(*envptr) * filesize) {
-                               fprintf(stderr, "Can't read the whole input file (%ld bytes): %s\n",
+                               fprintf(stderr, "Can't read the whole input file (%zu bytes): %s\n",
                                        sizeof(*envptr) * filesize,
                                        strerror(errno));