From: Glynn Clements <glynn.clements@virgin.net>
To: "Alphex K." <alphex@crew.org.ru>
Cc: linux-c-programming@vger.kernel.org
Subject: Re: Some troubles with dynamic structures ;-(
Date: Fri, 23 Jan 2004 00:02:15 +0000 [thread overview]
Message-ID: <16400.25735.492139.552175@cerise.nosuchdomain.co.uk> (raw)
In-Reply-To: <20040122232345.75911b51.alphex@crew.org.ru>
Alphex K. wrote:
> Where I have a mistake,
> integers in structure work normally, but
> I'm have a problem with pointers to char
The pointers are those returned from gtk_entry_get_text(), whose
documention says:
Retrieve the contents of the entry widget. The returned
pointer points to internally allocated storage in the widget
and must not be freed, modified or stored. For this reason,
this function is deprecated. Use gtk_editable_get_chars()
instead.
I take this as meaning that the data to which they point may become
invalid at the next operation to be performed on the GtkEntry (e.g.
the next time it receives a signal or is accessed via one of the
gtk_entry_* functions).
Use e.g. strdup() to copy the data, e.g.
aname=strdup(gtk_entry_get_text(GTK_ENTRY(namecentry)));
--
Glynn Clements <glynn.clements@virgin.net>
next prev parent reply other threads:[~2004-01-23 0:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-22 20:23 Some troubles with dynamic structures ;-( Alphex K.
2004-01-23 0:02 ` Glynn Clements [this message]
2004-01-23 16:41 ` Alphex K.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=16400.25735.492139.552175@cerise.nosuchdomain.co.uk \
--to=glynn.clements@virgin.net \
--cc=alphex@crew.org.ru \
--cc=linux-c-programming@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).