diff options
author | neonloop | 2021-08-04 22:40:32 +0000 |
---|---|---|
committer | neonloop | 2021-08-04 22:40:32 +0000 |
commit | b148bcce05254c7ebe0ad855e5f1e958968a0bb9 (patch) | |
tree | cfd96aa5a7eefaf20684c32943034652b713f3ce /options.c | |
parent | 2316cdca56925fab2f3faf6acb451fdaafb9f362 (diff) | |
download | picoarch-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.c | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -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++) ; |