Commit 297e7f3e authored by Bruce Momjian's avatar Bruce Momjian

Fix \h to not go past array bounds

parent 11ae8ba7
......@@ -3,7 +3,7 @@
*
* Copyright 2000 by PostgreSQL Global Development Group
*
* $Header: /cvsroot/pgsql/src/bin/psql/help.c,v 1.25 2000/04/12 17:16:22 momjian Exp $
* $Header: /cvsroot/pgsql/src/bin/psql/help.c,v 1.26 2000/04/24 22:41:43 momjian Exp $
*/
#include "postgres.h"
#include "help.h"
......@@ -265,13 +265,14 @@ helpSQL(const char *topic)
for (i = 0; i < items_per_column; i++)
{
printf(" %-25s%-25s%-25s\n",
printf(" %-25s%-25s",
VALUE_OR_NULL(QL_HELP[i].cmd),
VALUE_OR_NULL(QL_HELP[i + items_per_column].cmd),
VALUE_OR_NULL(QL_HELP[i + 2 * items_per_column].cmd)
);
VALUE_OR_NULL(QL_HELP[i + items_per_column].cmd));
if (i + 2 * items_per_column < QL_HELP_COUNT)
printf("%-25s",
VALUE_OR_NULL(QL_HELP[i + 2 * items_per_column].cmd));
fputc('\n', stdout);
}
putc('\n', stdout);
}
else
......
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