:: commit 94ff47ea0ed3f58955c1ba23c955fe2862ad9435

mintsuki <mintsuki@protonmail.com> — 2020-07-01 02:34

parents: 43918c96c3

Fix issues in qloader2-install.c

diff --git a/qloader2-install.c b/qloader2-install.c
index 3540c5b6..bc686797 100644
--- a/qloader2-install.c
+++ b/qloader2-install.c
@@ -25,7 +25,7 @@ int main(int argc, char *argv[]) {
 
     uint32_t stage2_sect = 1;
     if (argc >= 4)
-        sscanf(argv[3], SCNu32, &stage2_sect);
+        sscanf(argv[3], "%" SCNu32, &stage2_sect);
 
     char orig_mbr[64];
     fseek(device, 446, SEEK_SET);
@@ -45,7 +45,7 @@ int main(int argc, char *argv[]) {
     free(ql2_stage2);
 
     fseek(device, 0x1b0, SEEK_SET);
-    fprintf(device, PRIu32, stage2_sect);
+    fwrite(&stage2_sect, 1, 4, device);
 
     fseek(device, 446, SEEK_SET);
     fwrite(orig_mbr, 1, 64, device);
tab: 248 wrap: offon