@@ -725,31 +725,31 @@ let gprintf (finish : doc -> 'b)
725725 invalid_arg (" dprintf: unimplemented format "
726726 ^ (String. sub format i (j- i+ 1 )));
727727 let j' = succ j in (* eat the d,i,x etc. *)
728- let format_spec = Bytes. of_string " % " in
729- Bytes. set format_spec 1 (fget j'); (* format_spec = "%x ", etc. *)
728+ let format_spec = Bytes. of_string " %L " in
729+ Bytes. set format_spec 2 (fget j'); (* format_spec = "%Lx ", etc. *)
730730 Obj. magic(fun n ->
731731 collect (dctext1 acc
732- (Int64. format ( Bytes. to_string format_spec) n))
732+ (Printf. sprintf ( Scanf. format_from_string ( Bytes. to_string format_spec) " %Lx " ) n))
733733 (succ j'))
734734 | 'l' ->
735735 if j != i + 1 then invalid_arg (" dprintf: unimplemented format "
736736 ^ (String. sub format i (j- i+ 1 )));
737737 let j' = succ j in (* eat the d,i,x etc. *)
738- let format_spec = Bytes. of_string " % " in
739- Bytes. set format_spec 1 (fget j'); (* format_spec = "%x ", etc. *)
738+ let format_spec = Bytes. of_string " %l " in
739+ Bytes. set format_spec 2 (fget j'); (* format_spec = "%lx ", etc. *)
740740 Obj. magic(fun n ->
741741 collect (dctext1 acc
742- (Int32. format ( Bytes. to_string format_spec) n))
742+ (Printf. sprintf ( Scanf. format_from_string ( Bytes. to_string format_spec) " %lx " ) n))
743743 (succ j'))
744744 | 'n' ->
745745 if j != i + 1 then invalid_arg (" dprintf: unimplemented format "
746746 ^ (String. sub format i (j- i+ 1 )));
747747 let j' = succ j in (* eat the d,i,x etc. *)
748- let format_spec = Bytes. of_string " % " in
749- Bytes. set format_spec 1 (fget j'); (* format_spec = "%x ", etc. *)
748+ let format_spec = Bytes. of_string " %n " in
749+ Bytes. set format_spec 2 (fget j'); (* format_spec = "%nx ", etc. *)
750750 Obj. magic(fun n ->
751751 collect (dctext1 acc
752- (Nativeint. format ( Bytes. to_string format_spec) n))
752+ (Printf. sprintf ( Scanf. format_from_string ( Bytes. to_string format_spec) " %nx " ) n))
753753 (succ j'))
754754 | 'f' | 'e' | 'E' | 'g' | 'G' ->
755755 Obj. magic(fun f ->
0 commit comments