summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/output.c2
-rw-r--r--lib/parse_ini.c8
2 files changed, 6 insertions, 4 deletions
diff --git a/lib/output.c b/lib/output.c
index 62e1366d..d650a3c5 100644
--- a/lib/output.c
+++ b/lib/output.c
@@ -175,7 +175,7 @@ char *get_subcheck_summary(mp_check check) {
175 unsigned int critical = 0; 175 unsigned int critical = 0;
176 unsigned int unknown = 0; 176 unsigned int unknown = 0;
177 while (subchecks != NULL) { 177 while (subchecks != NULL) {
178 switch (subchecks->subcheck.state) { 178 switch (mp_compute_subcheck_state(subchecks->subcheck)) {
179 case STATE_OK: 179 case STATE_OK:
180 ok++; 180 ok++;
181 break; 181 break;
diff --git a/lib/parse_ini.c b/lib/parse_ini.c
index db337622..196cac79 100644
--- a/lib/parse_ini.c
+++ b/lib/parse_ini.c
@@ -352,15 +352,17 @@ static int add_option(FILE *filePointer, np_arg_list **optlst) {
352 optnew->next = NULL; 352 optnew->next = NULL;
353 353
354 read_pos = 0; 354 read_pos = 0;
355 optnew->arg = malloc(cfg_len + 1); 355 size_t arg_length = cfg_len + 1;
356 optnew->arg = malloc(arg_length);
356 /* 1-character params needs only one dash */ 357 /* 1-character params needs only one dash */
357 if (opt_len == 1) { 358 if (opt_len == 1) {
358 strncpy(&optnew->arg[read_pos], "-", 1); 359 strncpy(&optnew->arg[read_pos], "-", arg_length);
359 read_pos += 1; 360 read_pos += 1;
360 } else { 361 } else {
361 strncpy(&optnew->arg[read_pos], "--", 2); 362 strncpy(&optnew->arg[read_pos], "--", arg_length);
362 read_pos += 2; 363 read_pos += 2;
363 } 364 }
365
364 strncpy(&optnew->arg[read_pos], optptr, opt_len); 366 strncpy(&optnew->arg[read_pos], optptr, opt_len);
365 read_pos += opt_len; 367 read_pos += opt_len;
366 if (value) { 368 if (value) {