sstrncpy(ds->type, fields[0], sizeof(ds->type));
ds->ds_num = fields_num - 1;
- ds->ds = (data_source_t *)calloc(ds->ds_num, sizeof(data_source_t));
+ ds->ds = calloc(ds->ds_num, sizeof(*ds->ds));
if (ds->ds == NULL) {
sfree(ds);
return;
fh = fopen(file, "r");
if (fh == NULL) {
- char errbuf[1024];
fprintf(stderr, "Failed to open types database `%s': %s.\n", file,
- sstrerror(errno, errbuf, sizeof(errbuf)));
- ERROR("Failed to open types database `%s': %s", file,
- sstrerror(errno, errbuf, sizeof(errbuf)));
+ STRERRNO);
+ ERROR("Failed to open types database `%s': %s", file, STRERRNO);
return -1;
}