On 3/24/07, John Stanton <[EMAIL PROTECTED]> wrote:
Andrew Finkenstadt wrote:
> On 3/24/07, John Stanton <[EMAIL PROTECTED]> wrote:
>
>>
>> Compilers do not terminate strings, library functions do.
>
>
>
> You are guaranteed by the C standard that the string referred to by
>
>>> const char message[] = "this string";
>
>
> is null-terminated by the compiler.
>
Of course you are correct.  However this string is read only and if you
use GNU C and try to write to it you get a kick in the head.

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------


Yes, and I am not writing to it... I am binding a string like
message[] to a sqlite query (using sqlite3_bind_text(stmt, bIndex,
value, -1, SQLITE_TRANSIENT);
) requesting that SQL count the length of the string, and SQLite
apparently calls strlen().  One of the calls to strlen segfaulted.  I
was wondering if anyone every had this same error.   I figure either
sqlite made a mistake, or there is a problem with the libc library
(this is an ARM arch).  If the consensus is that this is libc's
problem I will move this discussion to that list.

Of course, I guess I could determine if it is libc's fault by
replacing the -1 with strlen(message) and seeing if I see the same
problem.

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to