--- a/faked.c
+++ b/faked.c
@@ -617,11 +617,11 @@ int save_database(const uint32_t remote)
 
 #ifdef FAKEROOT_DB_PATH
     if (find_path(i->buf.dev, i->buf.ino, roots, path))
-      fprintf(f,"mode=%llo,uid=%llu,gid=%llu,nlink=%llu,rdev=%llu %s\n",
+      fprintf(f,"mode=%"PRIo64",uid=%"PRIu64",gid=%"PRIu64",nlink=%"PRIu64",rdev=%"PRIu64" %s\n",
               (uint64_t) i->buf.mode,(uint64_t) i->buf.uid,(uint64_t) i->buf.gid,
               (uint64_t) i->buf.nlink,(uint64_t) i->buf.rdev,path);
 #else
-    fprintf(f,"dev=%llx,ino=%llu,mode=%llo,uid=%llu,gid=%llu,nlink=%llu,rdev=%llu\n",
+    fprintf(f,"dev=%"PRIx64",ino=%"PRIu64",mode=%"PRIo64",uid=%"PRIu64",gid=%"PRIu64",nlink=%"PRIu64",rdev=%"PRIu64"\n",
             (uint64_t) i->buf.dev,(uint64_t) i->buf.ino,(uint64_t) i->buf.mode,
             (uint64_t) i->buf.uid,(uint64_t) i->buf.gid,(uint64_t) i->buf.nlink,
             (uint64_t) i->buf.rdev);
@@ -647,7 +647,7 @@ int load_database(const uint32_t remote)
 
   while(1){
 #ifdef FAKEROOT_DB_PATH
-    r=scanf("mode=%llo,uid=%llu,gid=%llu,nlink=%llu,rdev=%llu "DB_PATH_SCAN"\n",
+    r=scanf("mode=%"PRIo64",uid=%"PRIu64",gid=%"PRIu64",nlink=%"PRIu64",rdev=%"PRIu64" "DB_PATH_SCAN"\n",
             &stmode, &stuid, &stgid, &stnlink, &strdev, &path);
     if (r != 6)
       break;
@@ -662,7 +662,7 @@ int load_database(const uint32_t remote)
     stdev = path_st.st_dev;
     stino = path_st.st_ino;
 #else
-    r=scanf("dev=%llx,ino=%llu,mode=%llo,uid=%llu,gid=%llu,nlink=%llu,rdev=%llu\n",
+    r=scanf("dev=%"PRIx64",ino=%"PRIu64",mode=%"PRIo64",uid=%"PRIu64",gid=%"PRIu64",nlink=%"PRIu64",rdev=%"PRIu64"\n",
             &stdev, &stino, &stmode, &stuid, &stgid, &stnlink, &strdev);
     if (r != 7)
       break;
