case CTF_TYPE_ENUM:
return print_enum(pretty, field);
case CTF_TYPE_STRING:
+ {
+ const char *str;
+
+ str = bt_ctf_field_string_get_value(field);
+ if (!str) {
+ return BT_COMPONENT_STATUS_ERROR;
+ }
+
if (pretty->use_colors) {
g_string_append(pretty->string, COLOR_STRING_VALUE);
}
- print_escape_string(pretty, bt_ctf_field_string_get_value(field));
+ print_escape_string(pretty, str);
if (pretty->use_colors) {
g_string_append(pretty->string, COLOR_RST);
}
return BT_COMPONENT_STATUS_OK;
+ }
case CTF_TYPE_STRUCT:
return print_struct(pretty, field, print_names, filter_fields,
filter_array_len);