Re: [fpc-devel] Zero terminated strings

2008-11-11 Thread Michael Schnell
Are strings not zero terminated? They are not: a #0 is perfectly allowable character in a (long) string. That is why you can use strings for storing any kind of byte stream. But they are: a #0 is automatically added at s[length(s)+1]; But accessing the terminating via string functions is erro

Re: [fpc-devel] Zero terminated strings

2008-11-10 Thread Vincent Snijders
ABorka schreef: Hi, Are strings not zero terminated? I have a function declared: function myfunc(s :String; i: Integer):String; When going through the string "s" with asm instructions, it does not seem to have a zero byte at the end. Is this normal or something is not OK (maybe now with utf8

Re: [fpc-devel] Zero terminated strings

2008-11-10 Thread dmitry boyarintsev
strings are always null-terminated, for delphi compatibility. zero char is located at s[length(s)+1], but should never accessed directly. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel