Skip to content

Commit 1f3811c

Browse files
committed
Merge commit '266b7f8ae10c4cd1d39e97173c7558032ab3ff52' into jag/kconfig
* commit '266b7f8ae10c4cd1d39e97173c7558032ab3ff52': Squashed 'scripts/kconfig/' changes from 24b4fc2..be6ba4d
2 parents 447b2ca + 266b7f8 commit 1f3811c

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

scripts/kconfig/confdata.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -669,14 +669,16 @@ static char *conf_value_to_yaml(struct symbol *sym, const char *val)
669669
yaml_value = strdup(val);
670670
break;
671671
case S_HEX:
672-
asprintf(&yaml_value, "0x%s", val);
673-
break;
674-
case S_STRING:
675-
/* Wrap strings in quotes */
676-
asprintf(&yaml_value, "\"%s\"", val);
677-
break;
678-
case S_BOOLEAN:
679-
case S_TRISTATE:
672+
if (asprintf(&yaml_value, "0x%s", val) < 0)
673+
return NULL;
674+
break;
675+
case S_STRING:
676+
/* Wrap strings in quotes */
677+
if (asprintf(&yaml_value, "\"%s\"", val) < 0)
678+
return NULL;
679+
break;
680+
case S_BOOLEAN:
681+
case S_TRISTATE:
680682
if (strcmp(val, "y") == 0)
681683
yaml_value = strdup("True");
682684
else if (strcmp(val, "n") == 0)

0 commit comments

Comments
 (0)