diff --git a/lib/access.c b/lib/access.c index af296abc..01c345ea 100644 --- a/lib/access.c +++ b/lib/access.c @@ -201,8 +201,7 @@ char *sensors_get_label(const sensors_chip_name *name, sensors_get_label_exit: if (!label) - sensors_fatal_error("sensors_get_label", - "Allocating label text"); + sensors_fatal_error(__func__, "Allocating label text"); return label; } diff --git a/lib/conf-parse.y b/lib/conf-parse.y index 6641253a..ea6be705 100644 --- a/lib/conf-parse.y +++ b/lib/conf-parse.y @@ -342,7 +342,6 @@ sensors_expr *malloc_expr(void) { sensors_expr *res = malloc(sizeof(sensors_expr)); if (! res) - sensors_fatal_error("malloc_expr","Allocating a new expression"); + sensors_fatal_error(__func__, "Allocating a new expression"); return res; } - diff --git a/lib/data.c b/lib/data.c index 54e3fdce..4f0072eb 100644 --- a/lib/data.c +++ b/lib/data.c @@ -88,7 +88,7 @@ int sensors_parse_chip_name(const char *name, sensors_chip_name *res) return -SENSORS_ERR_CHIP_NAME; res->prefix = strndup(name, dash - name); if (!res->prefix) - sensors_fatal_error("sensors_parse_chip_name", + sensors_fatal_error(__func__, "Allocating name prefix"); name = dash + 1; } diff --git a/lib/general.c b/lib/general.c index ef05f0d1..9d50bb02 100644 --- a/lib/general.c +++ b/lib/general.c @@ -34,8 +34,7 @@ void sensors_malloc_array(void *list, int *num_el, int *max_el, int el_size) *my_list = malloc(el_size*A_BUNCH); if (! *my_list) - sensors_fatal_error("sensors_malloc_array", - "Allocating new elements"); + sensors_fatal_error(__func__, "Allocating new elements"); *max_el = A_BUNCH; *num_el = 0; } @@ -59,7 +58,7 @@ void sensors_add_array_el(const void *el, void *list, int *num_el, new_max_el = *max_el + A_BUNCH; *my_list = realloc(*my_list, new_max_el * el_size); if (! *my_list) - sensors_fatal_error("sensors_add_array_el", + sensors_fatal_error(__func__, "Allocating new elements"); *max_el = new_max_el; } @@ -77,7 +76,7 @@ void sensors_add_array_els(const void *els, int nr_els, void *list, new_max_el -= new_max_el % A_BUNCH; *my_list = realloc(*my_list, new_max_el * el_size); if (! *my_list) - sensors_fatal_error("sensors_add_array_els", + sensors_fatal_error(__func__, "Allocating new elements"); *max_el = new_max_el; }