~ubuntu-branches/ubuntu/precise/pciutils/precise

« back to all changes in this revision

Viewing changes to lib/dump.c

  • Committer: Bazaar Package Importer
  • Author(s): Anibal Monsalve Salazar
  • Date: 2010-06-26 14:17:57 UTC
  • mfrom: (2.1.18 sid)
  • Revision ID: james.westby@ubuntu.com-20100626141757-xsp7xqv15qotwels
Tags: 1:3.1.7-4
Update pci.ids with snapshot dated 2010-06-12

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
    {
71
71
      char *z = strchr(buf, '\n');
72
72
      if (!z)
73
 
        a->error("dump: line too long or unterminated");
 
73
        {
 
74
          fclose(f);
 
75
          a->error("dump: line too long or unterminated");
 
76
        }
74
77
      *z-- = 0;
75
78
      if (z >= buf && *z == '\r')
76
79
        *z-- = 0;
95
98
                 sscanf(z, "%x", &j) == 1 && j < 256)
96
99
            {
97
100
              if (i >= 4096)
98
 
                a->error("dump: At most 4096 bytes of config space are supported");
 
101
                {
 
102
                  fclose(f);
 
103
                  a->error("dump: At most 4096 bytes of config space are supported");
 
104
                }
99
105
              if (i >= dd->allocated)   /* Need to re-allocate the buffer */
100
106
                {
101
107
                  dump_alloc_data(dev, 4096);
111
117
                z++;
112
118
            }
113
119
          if (*z)
114
 
            a->error("dump: Malformed line");
 
120
            {
 
121
              fclose(f);
 
122
              a->error("dump: Malformed line");
 
123
            }
115
124
        }
116
125
    }
 
126
  fclose(f);
117
127
}
118
128
 
119
129
static void
173
183
  pci_generic_fill_info,
174
184
  dump_read,
175
185
  dump_write,
 
186
  NULL,                                 /* read_vpd */
176
187
  NULL,                                 /* init_dev */
177
188
  dump_cleanup_dev
178
189
};