diff --git a/librz/core/cmd/cmd_search.c b/librz/core/cmd/cmd_search.c index a869405be96..c7a7958ed62 100644 --- a/librz/core/cmd/cmd_search.c +++ b/librz/core/cmd/cmd_search.c @@ -97,7 +97,7 @@ static RzCmdStatus cmd_core_handle_search_hits(RzCore *core, RzCmdStateOutput *s } // only output & add flag when cmd.hit is not set. - const char *meta = hit->metadata ? hit->metadata : "match"; + const char *meta = hit->hit_desc ? hit->hit_desc : "match"; char *flag = rz_str_newf("%s.%s.%" PFMTSZu, search_prefix, meta, counter); rz_flag_set(core->flags, flag, hit->address, hit->size); cmd_search_output_to_state(state, hit, flag); diff --git a/librz/include/rz_search.h b/librz/include/rz_search.h index b3a545a2786..6ca8f8c337a 100644 --- a/librz/include/rz_search.h +++ b/librz/include/rz_search.h @@ -21,7 +21,7 @@ typedef struct rz_search_opt_t RzSearchOpt; typedef struct rz_search_collection_t RzSearchCollection; typedef struct rz_search_hit_t { - char *metadata; ///< Metadata for extra details (can be NULL) + char *hit_desc; ///< Hit description (can be NULL) ut64 address; ///< Address the matched data size_t size; ///< Size of the matched data (can be 0) } RzSearchHit; diff --git a/librz/main/rz-find.c b/librz/main/rz-find.c index 12709000e03..d7aced95629 100644 --- a/librz/main/rz-find.c +++ b/librz/main/rz-find.c @@ -182,11 +182,11 @@ static void rz_find_output_hit(RzFindOptions *ro, RzSearchHit *hit, RzCore *core pj_o(ro->pj); pj_kn(ro->pj, "address", hit->address); pj_kn(ro->pj, "size", hit->size); - pj_ks(ro->pj, "type", hit->metadata); + pj_ks(ro->pj, "type", hit->hit_desc); pj_end(ro->pj); break; case RZ_FIND_OUTPUT_STANDARD: - printf("0x%" PFMT64x " %" PFMTSZu " %s\n", hit->address, hit->size, hit->metadata); + printf("0x%" PFMT64x " %" PFMTSZu " %s\n", hit->address, hit->size, hit->hit_desc); break; case RZ_FIND_OUTPUT_HEXDUMP: rz_find_output_hit_as_hexdump(ro, hit, core); diff --git a/librz/search/search.c b/librz/search/search.c index 1d6cae82733..31c3585cb41 100644 --- a/librz/search/search.c +++ b/librz/search/search.c @@ -146,18 +146,18 @@ RZ_API RZ_OWN RzList /**/ *rz_search_run(RZ_NONNULL RzSearchOpt * /** * \brief Allocate and initialize a new RzSearchHit * - * \param[in] metadata The metadata linked to the hit (can be NULL) + * \param[in] hit_desc The hit description linked to the hit (can be NULL) * \param[in] address The address where the hit happened * \param[in] size The size of the hit data (can be 0) * * \return On success returns a valid pointer, otherwise NULL */ -RZ_IPI RZ_OWN RzSearchHit *rz_search_hit_new(const char *metadata, ut64 address, size_t size) { +RZ_IPI RZ_OWN RzSearchHit *rz_search_hit_new(const char *hit_desc, ut64 address, size_t size) { RzSearchHit *hit = RZ_NEW0(RzSearchHit); if (!hit) { return NULL; } - hit->metadata = rz_str_dup(metadata); + hit->hit_desc = rz_str_dup(hit_desc); hit->address = address; hit->size = size; return hit; @@ -172,6 +172,6 @@ RZ_API void rz_search_hit_free(RZ_NULLABLE RzSearchHit *hit) { if (!hit) { return; } - free(hit->metadata); + free(hit->hit_desc); free(hit); }