1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-05 02:22:28 +03:00

Provide Assert() for frontend code.

Per discussion on-hackers. psql is converted to use the new code.

Follows a suggestion from Heikki Linnakangas.
This commit is contained in:
Andrew Dunstan
2012-12-14 18:03:07 -05:00
parent 75758a6ff0
commit 1c382655ad
7 changed files with 30 additions and 25 deletions

View File

@@ -245,8 +245,8 @@ strip_quotes(char *source, char quote, char escape, int encoding)
char *src;
char *dst;
psql_assert(source);
psql_assert(quote);
Assert(source != NULL);
Assert(quote != '\0');
src = dst = source;
@@ -299,8 +299,8 @@ quote_if_needed(const char *source, const char *entails_quote,
char *dst;
bool need_quotes = false;
psql_assert(source);
psql_assert(quote);
Assert(source != NULL);
Assert(quote != '\0');
src = source;
dst = ret = pg_malloc(2 * strlen(src) + 3); /* excess */