Make the filenames in the list constant.
This commit is contained in:
@@ -56,7 +56,7 @@ struct opts_s { /* structure describing run-time options */
|
||||
/*@keep@*/ /*@null@*/ char *format; /* output format, if any */
|
||||
/*@keep@*/ /*@null@*/ char *pidfile; /* PID file, if any */
|
||||
unsigned int argc; /* number of non-option arguments */
|
||||
/*@keep@*/ /*@null@*/ char **argv; /* array of non-option arguments */
|
||||
/*@keep@*/ /*@null@*/ const char **argv; /* array of non-option arguments */
|
||||
unsigned int argv_length; /* allocated array size */
|
||||
};
|
||||
|
||||
@@ -65,7 +65,7 @@ struct opts_s { /* structure describing run-time options */
|
||||
|
||||
extern /*@null@*/ /*@only@*/ opts_t opts_parse(unsigned int, char **);
|
||||
extern void opts_free(/*@only@*/ opts_t);
|
||||
extern bool opts_add_file(opts_t, char *);
|
||||
extern bool opts_add_file(opts_t, const char *);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
+1
-1
@@ -88,7 +88,7 @@ void opts_free( /*@only@ */ opts_t opts)
|
||||
* Add a filename to the list of non-option arguments, returning false on
|
||||
* error. The filename is not copied - the pointer is stored.
|
||||
*/
|
||||
bool opts_add_file(opts_t opts, char *filename)
|
||||
bool opts_add_file(opts_t opts, const char *filename)
|
||||
{
|
||||
/*@-branchstate@ */
|
||||
if ((opts->argc >= opts->argv_length) || (NULL == opts->argv)) {
|
||||
|
||||
Reference in New Issue
Block a user