Radish alpha
H
HardenedBSD Package Manager
Radicle
Git (anonymous pull)
Log in to clone via SSH
Improve error message for bad/incomplete expression. It's still possible to generate an invalid expression with a non-matching number of opening and closing brackets.
Rolf Grossmann committed 13 years ago
commit c5815f18b0a0003d391b169c0a3f48d664a32409
parent 4d5d751f53b26f75c76036916ffab01fc274f69e
1 file changed +4 -0
modified pkg/query.c
@@ -562,6 +562,10 @@ format_sql_condition(const char *str, struct sbuf *sqlcond)
	}
	if (state == STRING)
		sbuf_putc(sqlcond, '\'');
+
	else if (state != NONE && state != INT) {
+
		fprintf(stderr, "unexpected end of expression\n");
+
		return (EPKG_FATAL);
+
	}

	return (EPKG_OK);
}