Do not print "\000" at end of printf/scanf format strings.
This happened due to the change to include the null terminator in the internal representation of strings.
This commit is contained in:
parent
91d33b586d
commit
cb5db95476
12
Printf.pas
12
Printf.pas
|
@ -136,7 +136,7 @@ var
|
||||||
WriteLine;
|
WriteLine;
|
||||||
if s <> nil then begin
|
if s <> nil then begin
|
||||||
Write(' > "');
|
Write(' > "');
|
||||||
for i := 1 to s^.length do begin
|
for i := 1 to s^.length-1 do begin
|
||||||
ch := s^.str[i];
|
ch := s^.str[i];
|
||||||
if ch in [' '..'~'] then begin
|
if ch in [' '..'~'] then begin
|
||||||
if ch in ['"','\','?'] then
|
if ch in ['"','\','?'] then
|
||||||
|
@ -167,13 +167,13 @@ var
|
||||||
Write(' ');
|
Write(' ');
|
||||||
if offset = 0 then
|
if offset = 0 then
|
||||||
if s <> nil then begin
|
if s <> nil then begin
|
||||||
offset := s^.length;
|
offset := s^.length-1;
|
||||||
write(' ');
|
write(' ');
|
||||||
end; {if}
|
end; {if}
|
||||||
if offset > 0 then begin
|
if s <> nil then begin
|
||||||
if s <> nil then begin
|
if offset > 0 then begin
|
||||||
if offset > s^.length then
|
if offset > s^.length-1 then
|
||||||
offset := s^.length;
|
offset := s^.length-1;
|
||||||
for i := 1 to offset do begin
|
for i := 1 to offset do begin
|
||||||
ch := s^.str[i];
|
ch := s^.str[i];
|
||||||
if ch in [' '..'~'] then begin
|
if ch in [' '..'~'] then begin
|
||||||
|
|
Loading…
Reference in New Issue