Changeset: 8bc4b838f165 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/8bc4b838f165 Modified Files: sql/server/sqlparse.c Branch: default Log Message:
Fixes crash in sqlparse's indent option diffs (12 lines): diff --git a/sql/server/sqlparse.c b/sql/server/sqlparse.c --- a/sql/server/sqlparse.c +++ b/sql/server/sqlparse.c @@ -227,7 +227,7 @@ dlist2string(mvc *sql, dlist *l, char *s } if (rb) { /* here we do (depth - 1) * tab + 1 * newline to align with the parent op */ - size_t depth_chars = indent ? depth : 0; + size_t depth_chars = indent ? (depth > 0 ? depth : 1) : 0; char *o = SA_NEW_ARRAY(sql->ta, char, depth_chars + strlen(b) + strlen(rb) + 1); if (o) { _______________________________________________ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org