Fix \h to not go past array bounds
This commit is contained in:
parent
11ae8ba7ea
commit
297e7f3ef4
@ -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",
|
||||
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)
|
||||
);
|
||||
printf(" %-25s%-25s",
|
||||
VALUE_OR_NULL(QL_HELP[i].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
|
||||
|
Loading…
Reference in New Issue
Block a user