From 3e9c234823bd435f8a273dc7287a181f42a5d3ba Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 15 Apr 2011 16:54:40 +0000 Subject: proper escape --- src/monkey/edb_api.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/monkey') diff --git a/src/monkey/edb_api.c b/src/monkey/edb_api.c index df88dc326..65b16a4a6 100644 --- a/src/monkey/edb_api.c +++ b/src/monkey/edb_api.c @@ -101,8 +101,8 @@ GNUNET_MONKEY_EDB_get_expression_scope_end(struct GNUNET_MONKEY_EDB_Context *cnt char *errMsg; char *query; - if (asprintf(&query, "select end_lineno from Expression where file_name LIKE \'\%/%s\' and start_lineno = %d", file_name, start_line_no) == -1) { - GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Memory allocation problem occurred during creating database query!\n"); + if (asprintf(&query, "select end_lineno from Expression where file_name LIKE \'%%/%s\' and start_lineno = %d", file_name, start_line_no) == -1) { + GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Memory allocation problem occurred during creating database query!\n"); return GNUNET_NO; } @@ -141,7 +141,7 @@ GNUNET_MONKEY_EDB_get_expressions (struct GNUNET_MONKEY_EDB_Context *cntxt, char *query; if (asprintf (&query, - "select expr_syntax, start_lineno from Expression where file_name LIKE \'\%/%s\' and start_lineno <= %d and end_lineno = %d", + "select expr_syntax, start_lineno from Expression where file_name LIKE \'%%/%s\' and start_lineno <= %d and end_lineno = %d", file_name, start_line_no, end_line_no) == -1) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, -- cgit v1.2.3