bug-guile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Weird scm_to_latin1_string() behavior.


From: Stefan Israelsson Tampe
Subject: Re: Weird scm_to_latin1_string() behavior.
Date: Sat, 10 Sep 2011 16:03:55 +0200

using strndup in stead of strdup fixes this acording to the attached git-diff.
so it remains to make sure strndup is portable I guess.

/Stefan

On Sat, Sep 10, 2011 at 3:33 AM, David Hansen <address@hidden> wrote:
Hello,

the attached code produces

$ ./a.out
foo,bar
bar

while I would expect

$ ./a.out
foo
bar

Similar behavior can be produced with `substring', but `substring/copy'
will work as expected.  So I suspect this is some issue with strings
sharing memory and a missing '0' when scm_to_latin1_string calls
scm_strdup.

David


Attachment: strndupfix.diff
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]