|
Boost Users : |
From: Venkat Rangan (venkat.rangan_at_[hidden])
Date: 2007-08-18 11:37:57
John,
Thanks for following up. We know the size of the buffer we allocated. A
workaround is to insert a NULL character at the end of the buffer, but
given that these messages are created elsewhere in other components and
are delivered to our search module, we do not have an opportunity to
insert NULL character, forcing a copy to separate buffer under our
control.
The ideal interface would be:
1) terminate when NULL character is found
2) if NULL character not found, terminate when end marker is reached.
-venkat
-----Original Message-----
From: boost-users-bounces_at_[hidden]
[mailto:boost-users-bounces_at_[hidden]] On Behalf Of John Maddock
Sent: Saturday, August 18, 2007 2:12 AM
To: boost-users_at_[hidden]
Subject: Re: [Boost-users] regex_search on non-NULL terminated strings.
Venkat Rangan wrote:
> John,
>
> Thanks very much - this is almost what we want. We did notice that if
> there is a null before the end, the search does not stop. Any way to
> overcome that? We wouldn't mind doing a strlen(), but that is prone to
> failure, so something like strlen_s() or a safe strlen would help. But
> strlen_s() is not available in Microsoft MSDN 7.1.
Ah, so you want the search to terminate if *either*:
* There is a NULL character
* We hit a certain length
Is that right?
I must admit to being a tad confused here: how do you know how long the
string is (when it's created for example?) Surely you must have a
length
stored somewhere?
John.
_______________________________________________
Boost-users mailing list
Boost-users_at_[hidden]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net