× 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.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.