X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Ftable.c;h=aebf0bbfad39123fba3f34b58d02c06bd743f1be;hb=66005379ede9257c7a9c52759cec95591121ad5c;hp=b0bc95f80bb90c5f999c525d17aa9d94bbc1d8b7;hpb=872126c9a7e0a8f8ae2b28217c12c27c35af5237;p=collectd.git diff --git a/src/table.c b/src/table.c index b0bc95f8..aebf0bbf 100644 --- a/src/table.c +++ b/src/table.c @@ -190,7 +190,7 @@ static int tbl_config_result (tbl_t *tbl, oconfig_item_t *ci) res = (tbl_result_t *)realloc (tbl->results, (tbl->results_num + 1) * sizeof (*tbl->results)); - if (NULL == tbl) { + if (res == NULL) { char errbuf[1024]; log_err ("realloc failed: %s.", sstrerror (errno, errbuf, sizeof (errbuf))); @@ -458,7 +458,7 @@ static int tbl_parse_line (tbl_t *tbl, char *line, size_t len) } if (i <= tbl->max_colnum) { - log_err ("Not enough columns in line " + log_warn ("Not enough columns in line " "(expected at least %zu, got %zu).", tbl->max_colnum + 1, i); return -1; @@ -490,11 +490,11 @@ static int tbl_read_table (tbl_t *tbl) while (NULL != fgets (buf, sizeof (buf), fh)) { if ('\0' != buf[sizeof (buf) - 1]) { buf[sizeof (buf) - 1] = '\0'; - log_err ("Table %s: Truncated line: %s", tbl->file, buf); + log_warn ("Table %s: Truncated line: %s", tbl->file, buf); } if (0 != tbl_parse_line (tbl, buf, sizeof (buf))) { - log_err ("Table %s: Failed to parse line: %s", tbl->file, buf); + log_warn ("Table %s: Failed to parse line: %s", tbl->file, buf); continue; } }