From: Tom Lane Date: Wed, 24 Apr 2002 15:56:38 +0000 (+0000) Subject: Don't dump core on empty table. X-Git-Tag: REL7_3~1607 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6260c7c1674890cba18622a6b783082a8300e963;p=postgresql Don't dump core on empty table. --- diff --git a/src/bin/psql/print.c b/src/bin/psql/print.c index 97da4d1816..892d88fdf0 100644 --- a/src/bin/psql/print.c +++ b/src/bin/psql/print.c @@ -3,7 +3,7 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/print.c,v 1.25 2001/10/30 05:38:56 momjian Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/print.c,v 1.26 2002/04/24 15:56:38 tgl Exp $ */ #include "postgres_fe.h" #include "print.h" @@ -1073,7 +1073,8 @@ printTable(const char *title, if (cells) for (ptr = cells; *ptr; ptr++) row_count++; - row_count /= col_count; + if (col_count > 0) + row_count /= col_count; if (opt->expanded) lines = (col_count + 1) * row_count;