This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new abdcb33f1 uORB/uORB; using array to save path for sensor_reginfo_s
abdcb33f1 is described below

commit abdcb33f14b4ddd50c96f34cc37df38250ea6c25
Author: dongjiuzhu1 <[email protected]>
AuthorDate: Fri Jun 28 10:32:08 2024 +0800

    uORB/uORB; using array to save path for sensor_reginfo_s
    
    Signed-off-by: dongjiuzhu1 <[email protected]>
---
 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);

Reply via email to