~maria-captains/maria/10.0

« back to all changes in this revision

Viewing changes to storage/connect/filamdbf.cpp

  • Committer: Olivier Bertrand
  • Date: 2013-12-28 15:56:51 UTC
  • mto: This revision was merged to the branch mainline in revision 3966.
  • Revision ID: bertrandop@gmail.com-20131228155651-deu3qzs9l0gz0r72
- Fix variables used uninitialized

modified:
  storage/connect/filamdbf.cpp
  storage/connect/tabutil.cpp

Show diffs side-by-side

added added

removed removed

Lines of Context:
178
178
/****************************************************************************/
179
179
PQRYRES DBFColumns(PGLOBAL g, const char *fn, BOOL info)
180
180
  {
181
 
  static int  buftyp[] = {TYPE_STRING, TYPE_SHORT, TYPE_STRING,
182
 
                          TYPE_INT,    TYPE_INT,   TYPE_SHORT};
183
 
  static XFLD fldtyp[] = {FLD_NAME, FLD_TYPE,   FLD_TYPENAME,
184
 
                          FLD_PREC, FLD_LENGTH, FLD_SCALE};
185
 
  static unsigned int length[] = {11, 6, 8, 10, 10, 6};
 
181
  int  buftyp[] = {TYPE_STRING, TYPE_SHORT, TYPE_STRING,
 
182
                   TYPE_INT,    TYPE_INT,   TYPE_SHORT};
 
183
  XFLD fldtyp[] = {FLD_NAME, FLD_TYPE,   FLD_TYPENAME,
 
184
                   FLD_PREC, FLD_LENGTH, FLD_SCALE};
 
185
  unsigned int length[] = {11, 6, 8, 10, 10, 6};
186
186
  char       buf[2], filename[_MAX_PATH];
187
187
  int        ncol = sizeof(buftyp) / sizeof(int);
188
188
  int        rc, type, len, field, fields;
189
189
  BOOL       bad;
190
190
  DBFHEADER  mainhead;
191
191
  DESCRIPTOR thisfield;
192
 
  FILE      *infile;
 
192
  FILE      *infile = NULL;
193
193
  PQRYRES    qrp;
194
194
  PCOLRES    crp;
195
195
 
228
228
  qrp = PlgAllocResult(g, ncol, fields, IDS_COLUMNS + 3,
229
229
                          buftyp, fldtyp, length, true, false);
230
230
 
231
 
  if (info || !qrp)
 
231
  if (info || !qrp) {
 
232
        if (infile)
 
233
      fclose(infile);
 
234
      
232
235
    return qrp;
 
236
    } // endif info
233
237
 
234
238
  if (trace) {
235
239
    htrc("Structure of %s\n", filename);