Commit 1a7be5cc authored by Bruce Momjian's avatar Bruce Momjian

Fix psql after newline patch for calloc(0).

Kris Jurka
parent b2be41a7
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Copyright (c) 2000-2005, PostgreSQL Global Development Group * Copyright (c) 2000-2005, PostgreSQL Global Development Group
* *
* $PostgreSQL: pgsql/src/bin/psql/print.c,v 1.80 2006/02/10 00:39:04 momjian Exp $ * $PostgreSQL: pgsql/src/bin/psql/print.c,v 1.81 2006/02/10 15:48:05 momjian Exp $
*/ */
#include "postgres_fe.h" #include "postgres_fe.h"
#include "common.h" #include "common.h"
...@@ -451,6 +451,7 @@ print_aligned_text(const char *title, const char *const * headers, ...@@ -451,6 +451,7 @@ print_aligned_text(const char *title, const char *const * headers,
* format_space contains maximum space required to store formatted string * format_space contains maximum space required to store formatted string
* so we prepare the formatting structures * so we prepare the formatting structures
*/ */
if (col_count > 0)
{ {
int heights_total = 0; int heights_total = 0;
struct lineptr *lineptr; struct lineptr *lineptr;
...@@ -470,6 +471,8 @@ print_aligned_text(const char *title, const char *const * headers, ...@@ -470,6 +471,8 @@ print_aligned_text(const char *title, const char *const * headers,
col_lineptrs[i]->ptr = format_buf[i]; col_lineptrs[i]->ptr = format_buf[i];
} }
} }
else
lineptr_list = NULL;
/* print title */ /* print title */
if (title && !opt_tuples_only) if (title && !opt_tuples_only)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment