Store name and format string in internal state as their own copies rather than pointers to strings outside the state, for memory safety and to avoid a leak on remote control.

This commit is contained in:
Andrew Wood
2023-08-26 20:49:30 +01:00
parent c0abc9ce3c
commit fe22f0e449
5 changed files with 35 additions and 15 deletions
+1 -1
View File
@@ -130,7 +130,7 @@ bool opts_add_file(opts_t opts, const char *filename)
* aren't copied anywhere, just the pointers are copied, so make sure the
* command line data isn't overwritten or argv[1] free()d or whatever.
*/
/*@null@ *//*@only@ */
/*@null@ */ /*@only@ */
opts_t opts_parse(unsigned int argc, char **argv)
{
#ifdef HAVE_GETOPT_LONG