Skip to content

Commit 1a7be5c

Browse files
committed
Fix psql after newline patch for calloc(0).
Kris Jurka
1 parent b2be41a commit 1a7be5c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/bin/psql/print.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/print.c,v 1.80 2006/02/10 00:39:04 momjian Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/print.c,v 1.81 2006/02/10 15:48:05 momjian Exp $
77
*/
88
#include "postgres_fe.h"
99
#include "common.h"
@@ -451,6 +451,7 @@ print_aligned_text(const char *title, const char *const * headers,
451451
* format_space contains maximum space required to store formatted string
452452
* so we prepare the formatting structures
453453
*/
454+
if (col_count > 0)
454455
{
455456
int heights_total = 0;
456457
struct lineptr *lineptr;
@@ -470,6 +471,8 @@ print_aligned_text(const char *title, const char *const * headers,
470471
col_lineptrs[i]->ptr = format_buf[i];
471472
}
472473
}
474+
else
475+
lineptr_list = NULL;
473476

474477
/* print title */
475478
if (title && !opt_tuples_only)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy