aboutsummaryrefslogtreecommitdiff
path: root/options.c
diff options
context:
space:
mode:
authorneonloop2021-08-04 22:40:32 +0000
committerneonloop2021-08-04 22:40:32 +0000
commitb148bcce05254c7ebe0ad855e5f1e958968a0bb9 (patch)
treecfd96aa5a7eefaf20684c32943034652b713f3ce /options.c
parent2316cdca56925fab2f3faf6acb451fdaafb9f362 (diff)
downloadpicoarch-b148bcce05254c7ebe0ad855e5f1e958968a0bb9.tar.gz
picoarch-b148bcce05254c7ebe0ad855e5f1e958968a0bb9.tar.bz2
picoarch-b148bcce05254c7ebe0ad855e5f1e958968a0bb9.zip
Only wrap option info if it exists
Diffstat (limited to 'options.c')
-rw-r--r--options.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/options.c b/options.c
index 2bac4b1..5d1b5d3 100644
--- a/options.c
+++ b/options.c
@@ -105,15 +105,17 @@ void options_init(const struct retro_core_option_definition *defs) {
strncpy(entry->desc, entry->def->desc, len);
truncate(entry->desc, MAX_DESC_LEN);
- len = strlen(entry->def->info) + 1;
- entry->info = (char *)calloc(len, sizeof(char));
- if (!entry->info) {
- PA_ERROR("Error allocating description string\n");
- options_free();
- return;
+ if (entry->def->info) {
+ len = strlen(entry->def->info) + 1;
+ entry->info = (char *)calloc(len, sizeof(char));
+ if (!entry->info) {
+ PA_ERROR("Error allocating description string\n");
+ options_free();
+ return;
+ }
+ strncpy(entry->info, entry->def->info, len);
+ wrap(entry->info, MAX_LINE_LEN, MAX_LINES);
}
- strncpy(entry->info, entry->def->info, len);
- wrap(entry->info, MAX_LINE_LEN, MAX_LINES);
for (j = 0; entry->def->values[j].value; j++)
;