LCDproc development and user support list

Text archives Help


[Lcdproc] config_get_string


Chronological Thread 
  • From: reenoo AT gmx.de (Rene Wagner)
  • Subject: [Lcdproc] config_get_string
  • Date: Sun Dec 2 22:53:02 2001

"Joris Robijn"
<joris AT robijn.net>
wrote:
> Rene,
>
> I saw (while debugging) that the use of the configfile functions in
> lcdm001.c was not yet completely safe, the string should be copied
> (it does currently work, but for how long...). I have made the
> comment in the configfile.h file a bit clearer.
>
> char *config_get_string( char * sectionname, char * keyname,
> int skip, char * default_value );
> // Returns a pointer to the string associated with the specified key.
> // The string should never be modified, and used only short-term. You
> can
> // for example scan it or copy it. In successive calls this function
> can
> // re-use the data space !
>
> Can you please copy the string ?

Yup! I've just modified the sources ;)

BTW: Is a strcpy OK?

In another version I've changed the whole way my driver handles data
(private_data struct), so I will have to modify that version, too, in order
to commit it.
I'll probably do so tomorrow ;)

Thanks,

Rene




Archive powered by MHonArc 2.6.18.

Top of page