Re: Problem with cmods

Chris Angelico <[email protected]>
Newsgroups gmane.comp.lang.pike.user
Message-ID <CAPTjJmqj1JxSJYJiKYADYDN86huzCQG6ffTRho3WCaMGaNtgkA@mail.gmail.com>
On Tue, Mar 25, 2014 at 7:23 PM, Christian Toepp <[email protected]> wrote:
> now, i have the next problem: i want to return a string from a function.
> i'm using push_text. it works with strings up to a length of 14
> characters (push_text("01234567890123") works fine). with all longer
> strings, i get "free(): invalid next size (fast)" after returning from
> the function. this is very strange. i use Pike v7.6.112 (to work with
> caudium).

I don't know about 7.6, as I build 8.0 from git, but it's probably the
same. Try using push_string(make_shared_string(s)) instead of
push_text(s); that's what I do. Your way looks better, but give both a
try.

ChrisA
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.