Make sp_parse() second argument (term) const

The term (filter) argument is strdup()'d and that copy gets destroyed by
the parsing.
This commit is contained in:
Julien BLACHE 2009-04-24 11:12:58 +02:00
parent 6ed689d1c9
commit 21209bd040
2 changed files with 2 additions and 2 deletions

View File

@ -710,7 +710,7 @@ PARSETREE sp_init(void) {
* @param term term or phrase to parse
* @returns 1 if successful, 0 if not
*/
int sp_parse(PARSETREE tree, char *term, int type) {
int sp_parse(PARSETREE tree, const char *term, int type) {
tree->term = strdup(term); /* will be destroyed by parsing */
tree->current=tree->term;
tree->token.token_id=T_BOF;

View File

@ -5,7 +5,7 @@
typedef void* PARSETREE;
extern PARSETREE sp_init(void);
extern int sp_parse(PARSETREE tree, char *term, int type);
extern int sp_parse(PARSETREE tree, const char *term, int type);
extern int sp_dispose(PARSETREE tree);
extern char *sp_get_error(PARSETREE tree);
extern char *sp_sql_clause(PARSETREE tree);