diff --git a/.gitattributes b/.gitattributes index 8e03d8aad8..7a5d5e8c32 100644 --- a/.gitattributes +++ b/.gitattributes @@ -6347,6 +6347,7 @@ tests/webtbs/tw4398.pp svneol=native#text/plain tests/webtbs/tw4427.pp svneol=native#text/plain tests/webtbs/tw4428.pp svneol=native#text/plain tests/webtbs/tw4450.pp svneol=native#text/plain +tests/webtbs/tw4489.pp -text svneol=unset#text/plain tests/webtbs/ub1873.pp svneol=native#text/plain tests/webtbs/ub1883.pp svneol=native#text/plain tests/webtbs/uw0555.pp svneol=native#text/plain diff --git a/rtl/objpas/sysutils/sysformt.inc b/rtl/objpas/sysutils/sysformt.inc index 4a961d5cf1..92c1ac365f 100644 --- a/rtl/objpas/sysutils/sysformt.inc +++ b/rtl/objpas/sysutils/sysformt.inc @@ -209,8 +209,10 @@ begin 'D' : begin if Checkarg(vtinteger,false) then Str(Args[Doarg].VInteger,ToAdd) - else if CheckArg(vtInt64,true) then - Str(Args[DoArg].VInt64^,toadd); + else if CheckArg(vtInt64,false) then + Str(Args[DoArg].VInt64^,toadd) + else if CheckArg(vtQWord,true) then + Str(int64(Args[DoArg].VQWord^),toadd); Width:=Abs(width); Index:=Prec-Length(ToAdd); If ToAdd[1]<>'-' then diff --git a/tests/webtbs/tw4489.pp b/tests/webtbs/tw4489.pp new file mode 100644 index 0000000000..a8a04e9220 --- /dev/null +++ b/tests/webtbs/tw4489.pp @@ -0,0 +1,25 @@ +{ Source provided for Free Pascal Bug Report 4489 } +{ Submitted by "Vincent Snijders" on 2005-11-04 } +{ e-mail: vsnijders@quicknet.nl } +program Project1; + +{$mode objfpc}{$H+} + +uses + Classes, SysUtils + { add your units here }; + +var + s: string; + u: SizeUInt; + d: qword; + +begin + d:=11111111; + u:=1111; + s := format('pid=%d', [u]); + writeln(s); + s := format('pid=%d', [d]); + writeln(s); +end. + \ No newline at end of file