From abdcb33f14b4ddd50c96f34cc37df38250ea6c25 Mon Sep 17 00:00:00 2001 From: dongjiuzhu1 Date: Fri, 28 Jun 2024 10:32:08 +0800 Subject: [PATCH] uORB/uORB; using array to save path for sensor_reginfo_s Signed-off-by: dongjiuzhu1 --- system/uorb/sensor/topics.c | 2 +- system/uorb/uORB/uORB.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/system/uorb/sensor/topics.c b/system/uorb/sensor/topics.c index 80af39c1b..d7e5523f4 100644 --- a/system/uorb/sensor/topics.c +++ b/system/uorb/sensor/topics.c @@ -170,5 +170,5 @@ FAR const struct orb_metadata *orb_get_meta(FAR const char *name) return NULL; } - return state.priv; + return (FAR const struct orb_metadata *)(uintptr_t)state.priv; } diff --git a/system/uorb/uORB/uORB.c b/system/uorb/uORB/uORB.c index a84bd1cf7..45f2d469d 100644 --- a/system/uorb/uORB/uORB.c +++ b/system/uorb/uORB/uORB.c @@ -70,7 +70,7 @@ static int orb_advsub_open(FAR const struct orb_metadata *meta, int flags, if (fd < 0) { struct sensor_reginfo_s reginfo; - reginfo.path = path; + strlcpy(reginfo.path, path, NAME_MAX); reginfo.esize = meta->o_size; reginfo.nbuffer = queue_size; reginfo.persist = !!(flags & SENSOR_PERSIST);