mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-06-09 00:32:05 -04:00
lib/parse_ini.c: Don't cast malloc(3) result
There's no need to cast malloc(3)'s return value.
This commit is contained in:
parent
95ed0a996c
commit
e2b8169869
1 changed files with 2 additions and 2 deletions
|
|
@ -274,11 +274,11 @@ static int add_option(FILE *f, np_arg_list **optlst){
|
|||
/* okay, now we have all the info we need, so we create a new np_arg_list
|
||||
* element and set the argument...
|
||||
*/
|
||||
optnew=(np_arg_list *)malloc(sizeof(np_arg_list));
|
||||
optnew=malloc(sizeof(np_arg_list));
|
||||
optnew->next=NULL;
|
||||
|
||||
read_pos=0;
|
||||
optnew->arg=(char *)malloc(cfg_len+1);
|
||||
optnew->arg=malloc(cfg_len+1);
|
||||
/* 1-character params needs only one dash */
|
||||
if(opt_len==1) {
|
||||
strncpy(&optnew->arg[read_pos], "-", 1);
|
||||
|
|
|
|||
Loading…
Reference in a new issue