*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.24 1998/09/01 04:33:43 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.25 1998/09/20 03:18:42 momjian Exp $
*
* Modifications - 6/12/96 - dave@bensoft.com - version 1.13.dhb.2
*
{
int i,
j;
- int parentInd;
+ int parentInd,
+ selfInd;
char **result;
int numParents;
{
parentInd = findTableByOid(tblinfo, numTables,
inhinfo[i].inhparent);
+ if (parentInd < 0)
+ {
+ selfInd = findTableByOid(tblinfo, numTables, oid);
+ fprintf(stderr,
+ "failed sanity check, parent oid %s of table %s (oid %s) was not found\n",
+ inhinfo[i].inhparent,
+ (selfInd >= 0) ? tblinfo[selfInd].relname : "",
+ oid);
+ exit(2);
+ }
result[j++] = tblinfo[parentInd].relname;
}
}
{
parentInd = findTableByName(tblinfo, numTables,
tblinfo[i].parentRels[k]);
+ if (parentInd < 0)
+ {
+ /* shouldn't happen unless findParentsByOid is broken */
+ fprintf(stderr, "failed sanity check, table %s not found by flagInhAttrs\n",
+ tblinfo[i].parentRels[k]);
+ exit(2);
+ }
for (j = 0; j < tblinfo[i].numatts; j++)
{
if (strInArray(tblinfo[i].attnames[j],
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.84 1998/09/03 02:10:36 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.85 1998/09/20 03:18:43 momjian Exp $
*
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
*
static void
prompt_for_password(char *username, char *password)
{
+ char buf[512];
int length;
#ifdef HAVE_TERMIOS_H
#endif
printf("Username: ");
- fgets(username, 9, stdin);
+ fgets(username, 100, stdin);
length = strlen(username);
/* skip rest of the line */
if (length > 0 && username[length - 1] != '\n')
{
- static char buf[512];
-
do
{
fgets(buf, 512, stdin);
t.c_lflag &= ~ECHO;
tcsetattr(0, TCSADRAIN, &t);
#endif
- fgets(password, 9, stdin);
+ fgets(password, 100, stdin);
#ifdef HAVE_TERMIOS_H
tcsetattr(0, TCSADRAIN, &t_orig);
#endif
/* skip rest of the line */
if (length > 0 && password[length - 1] != '\n')
{
- static char buf[512];
-
do
{
fgets(buf, 512, stdin);
int numTables;
char connect_string[512] = "";
char tmp_string[128];
- char username[64];
- char password[64];
+ char username[100];
+ char password[100];
int use_password = 0;
g_verbose = false;
for (i = 0; i < numIndices; i++)
{
tableInd = findTableByName(tblinfo, numTables,
- (indinfo[i].indrelname));
+ indinfo[i].indrelname);
+ if (tableInd < 0)
+ {
+ fprintf(stderr, "failed sanity check, table %s was not found\n",
+ indinfo[i].indrelname);
+ exit(2);
+ }
if (strcmp(indinfo[i].indproc, "0") == 0)
funcname = NULL;