×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
On Mon, May 23, 2016 at 8:42 AM, Bradley Stone <bvstone@xxxxxxxxx> wrote:
So how would a buffer length differ from the data or string length? Is it
the term "buffer" that is actually incorrect in this case then?
I'm curious about this too. How are you implementing the C strings?
The way Scott was talking about them is familiar to me from my ancient
C days. You (pre-)allocate an array of character (which is the
buffer). As I recall, it was more complicated and inefficient to
dynamically allocate exactly as much memory as you needed; so in
practice you just picked a fixed array size which should be big enough
to handle anything you're likely to encounter. (Very much like SQL or
RPG varying-length strings.)
If your buffer is always the exact length of your data, then it sounds
like either you have a more complicated implementation, or you have an
unsafe implementation, which would be why Scott wants to stick with
his string handling. But it seems like he does agree with you on
returning the current data length.
John Y.
As an Amazon Associate we earn from qualifying purchases.