Hi, I am trying to find some info on how I can use move to archive the following:
I am looking for an equal replacement of move(somepchar^, ansi_str_dest[1], len) The problem with ansi_str_dest[1] is that if the above call happens with a len of 0, and an ansi string with 0 length => this leads to a range check exception. SetLength(as,0); copy(src^, as[1], 0); Accessing the first of zero characters => range check. ( It will work without range-checking, since whatever address is returned by [1] is never accessed ) I could prefix it with "if length(dest) > 0 then ", but I would prefer something less noticeable... I could do SetLength(as,0); copy(src^, as, 0); But from looking at the assembler produced during compilation, this does not check for fpc_ansistr_unique. Same for any type casting to PChar. Anyone any idea? Thanks Martin _______________________________________________ fpc-devel maillist - [email protected] http://lists.freepascal.org/mailman/listinfo/fpc-devel
