tmp = realloc(*var, ((*len) + num) * sizeof(**var));
if (NULL == tmp) {
- char errbuf[1024];
- log_err("realloc failed: %s.", sstrerror(errno, errbuf, sizeof(errbuf)));
+ log_err("realloc failed: %s.", STRERRNO);
return -1;
}
*var = tmp;
tbl_result_t *res =
realloc(tbl->results, (tbl->results_num + 1) * sizeof(*tbl->results));
if (res == NULL) {
- char errbuf[1024];
- log_err("realloc failed: %s.", sstrerror(errno, errbuf, sizeof(errbuf)));
+ log_err("realloc failed: %s.", STRERRNO);
return -1;
}
tbl_t *tbl = realloc(tables, (tables_num + 1) * sizeof(*tables));
if (NULL == tbl) {
- char errbuf[1024];
- log_err("realloc failed: %s.", sstrerror(errno, errbuf, sizeof(errbuf)));
+ log_err("realloc failed: %s.", STRERRNO);
return -1;
}
}
if (res->values_num != res->ds->ds_num) {
- log_err("Invalid type \"%s\". Expected %zu data source%s, "
- "got %zu.",
+ log_err("Invalid type \"%s\". Expected %" PRIsz " data source%s, "
+ "got %" PRIsz ".",
res->type, res->values_num, (1 == res->values_num) ? "" : "s",
res->ds->ds_num);
return -1;
if (i <= tbl->max_colnum) {
log_warn("Not enough columns in line "
- "(expected at least %zu, got %zu).",
+ "(expected at least %" PRIsz ", got %" PRIsz ").",
tbl->max_colnum + 1, i);
return -1;
}
fh = fopen(tbl->file, "r");
if (NULL == fh) {
- char errbuf[1024];
- log_err("Failed to open file \"%s\": %s.", tbl->file,
- sstrerror(errno, errbuf, sizeof(errbuf)));
+ log_err("Failed to open file \"%s\": %s.", tbl->file, STRERRNO);
return -1;
}
}
if (0 != ferror(fh)) {
- char errbuf[1024];
- log_err("Failed to read from file \"%s\": %s.", tbl->file,
- sstrerror(errno, errbuf, sizeof(errbuf)));
+ log_err("Failed to read from file \"%s\": %s.", tbl->file, STRERRNO);
fclose(fh);
return -1;
}