Commit 32284eba authored by Olivier Bertrand's avatar Olivier Bertrand

- Fix variables used uninitialized

modified:
  storage/connect/filamdbf.cpp
  storage/connect/tabutil.cpp
parent c055e5e0
...@@ -178,18 +178,18 @@ static int dbfhead(PGLOBAL g, FILE *file, PSZ fn, DBFHEADER *buf) ...@@ -178,18 +178,18 @@ static int dbfhead(PGLOBAL g, FILE *file, PSZ fn, DBFHEADER *buf)
/****************************************************************************/ /****************************************************************************/
PQRYRES DBFColumns(PGLOBAL g, const char *fn, BOOL info) PQRYRES DBFColumns(PGLOBAL g, const char *fn, BOOL info)
{ {
static int buftyp[] = {TYPE_STRING, TYPE_SHORT, TYPE_STRING, int buftyp[] = {TYPE_STRING, TYPE_SHORT, TYPE_STRING,
TYPE_INT, TYPE_INT, TYPE_SHORT}; TYPE_INT, TYPE_INT, TYPE_SHORT};
static XFLD fldtyp[] = {FLD_NAME, FLD_TYPE, FLD_TYPENAME, XFLD fldtyp[] = {FLD_NAME, FLD_TYPE, FLD_TYPENAME,
FLD_PREC, FLD_LENGTH, FLD_SCALE}; FLD_PREC, FLD_LENGTH, FLD_SCALE};
static unsigned int length[] = {11, 6, 8, 10, 10, 6}; unsigned int length[] = {11, 6, 8, 10, 10, 6};
char buf[2], filename[_MAX_PATH]; char buf[2], filename[_MAX_PATH];
int ncol = sizeof(buftyp) / sizeof(int); int ncol = sizeof(buftyp) / sizeof(int);
int rc, type, len, field, fields; int rc, type, len, field, fields;
BOOL bad; BOOL bad;
DBFHEADER mainhead; DBFHEADER mainhead;
DESCRIPTOR thisfield; DESCRIPTOR thisfield;
FILE *infile; FILE *infile = NULL;
PQRYRES qrp; PQRYRES qrp;
PCOLRES crp; PCOLRES crp;
...@@ -228,8 +228,12 @@ PQRYRES DBFColumns(PGLOBAL g, const char *fn, BOOL info) ...@@ -228,8 +228,12 @@ PQRYRES DBFColumns(PGLOBAL g, const char *fn, BOOL info)
qrp = PlgAllocResult(g, ncol, fields, IDS_COLUMNS + 3, qrp = PlgAllocResult(g, ncol, fields, IDS_COLUMNS + 3,
buftyp, fldtyp, length, true, false); buftyp, fldtyp, length, true, false);
if (info || !qrp) if (info || !qrp) {
if (infile)
fclose(infile);
return qrp; return qrp;
} // endif info
if (trace) { if (trace) {
htrc("Structure of %s\n", filename); htrc("Structure of %s\n", filename);
......
...@@ -218,7 +218,8 @@ PQRYRES TabColumns(PGLOBAL g, THD *thd, const char *db, ...@@ -218,7 +218,8 @@ PQRYRES TabColumns(PGLOBAL g, THD *thd, const char *db,
if (type == TYPE_DECIM) if (type == TYPE_DECIM)
prec = ((Field_new_decimal*)fp)->precision; prec = ((Field_new_decimal*)fp)->precision;
else else
prec = (prec == NOT_FIXED_DEC) ? 0 : fp->field_length; prec = fp->field_length;
// prec = (prec(???) == NOT_FIXED_DEC) ? 0 : fp->field_length;
len = fp->char_length(); len = fp->char_length();
fmt = NULL; fmt = NULL;
......
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