16 Jan
2008
16 Jan
'08
10:24 a.m.
Hi, Thorsten Ottosen wrote:
Pavol Droba skrev:
Hi,
Thorsten Ottosen wrote:
I agree we could add a new function. Can we come up with a better name than as_c_str()?
Or should we simply make as_literal() scan the array?
I think, that as_literal should behave the same way for character arrays and for c-string. Different behaviour is unexpexted here.
The only difference that could be beneficial is that for arrays, the scanning for nulls can be bounded to protect agains the buffer overruns.
By an assertion, I pressume.
Not necessary. Why couldn't we take the whole array as a string when no null character is present? I don't see any problem with this approach.
Would you commit a fix to trunk then?
I can have a look at it. Regards, Pavol.