<br>This code seems to work:<br><br>std::string s = values.toStdString();<br>const char *psz_values=s.c_str();<br><br>is this fine, or does it break something else?<br><br><div class="gmail_quote">On Fri, Jun 17, 2011 at 11:18 PM, akash mehrotra <span dir="ltr"><<a href="mailto:mehrotra.akash@gmail.com">mehrotra.akash@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br><br><div class="gmail_quote"><div class="im">2011/6/17 Rémi Denis-Courmont <span dir="ltr"><<a href="mailto:remi@remlab.net" target="_blank">remi@remlab.net</a>></span><br>
</div><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Fri, 17 Jun 2011 16:09:08 +0530, akash mehrotra<br>
<div><<a href="mailto:mehrotra.akash@gmail.com" target="_blank">mehrotra.akash@gmail.com</a>> wrote:<br>
</div><div>> I'm not very sure, but the corruption seems to be happening in this<br>
line:<br>
>     const char *psz_values = values.toAscii().constData();<br>
><br>
> the length of "values" is correct till just before this, but after<br>
> conversion, psz_values is often shorter than it should be<br>
<br>
</div>QString::toAscii() creates a temporary anonymous object, which is garbage<br>
collected at the end of the statement, is that right? I wrote many times<br>
not to assign char pointers to temporary QString's...<br>
<font color="#888888"><br></font></blockquote></div><div>Yes, this line seems to be the issue, as printf("%s\n",(const char *)values.toAscii()); always gives the correct output.<br><br>What would you suggest as a replacement?<br>

</div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex"><font color="#888888">
--<br>
</font><div class="im"><div><div></div><div>Rémi Denis-Courmont<br>
<a href="http://www.remlab.net/" target="_blank">http://www.remlab.net/</a><br>
_______________________________________________<br>
vlc-devel mailing list<br>
To unsubscribe or modify your subscription options:<br>
<a href="http://mailman.videolan.org/listinfo/vlc-devel" target="_blank">http://mailman.videolan.org/listinfo/vlc-devel</a><br>
</div></div></div></blockquote></div><br>
</blockquote></div><br>