Fix #18309 - Better error messages for the pf command ##print (#18767)

This commit is contained in:
pancake 2021-05-28 01:18:31 +02:00 committed by GitHub
parent 23ad9b50ee
commit be3b640725
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1624,6 +1624,16 @@ static void cmd_print_format(RCore *core, const char *_input, const ut8* block,
char *space = strchr (name, ' ');
char *eq = strchr (name, '=');
char *dot = strchr (name, '.');
if (dot) {
*dot = 0;
}
if (!space && !sdb_const_get (core->print->formats, name, NULL)) {
eprintf ("Unknown format name '%s'.\n", name);
goto err_name;
}
if (dot) {
*dot = '.';
}
if (space) {
const char *afterspace = r_str_trim_head_ro (space + 1);
if (*afterspace == '=' && eq) {