blob: 7378bdea07cc405ad71afc4c7f57fd818b4e65a7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
program comparechar0bug;
var str1 : pchar = 'test';
str2 : pchar = 'test';
str3 : pchar = 'testa';
str4 : pchar = 'asdf';
res : longint;
begin
res:=CompareChar0(str1[0],str2[0],maxint);
if res<>0 then
halt(1);
res:=CompareChar0(str1[0],str3[0],maxint);
if res>=0 then
halt(1);
res:=CompareChar0(str4[0],str1[0],maxint);
if res>=0 then
halt(1);
res:=CompareChar0(str1[0],str4[0],maxint);
if res<=0 then
halt(1);
writeln('ok');
end.
|