diff options
-rw-r--r-- | bsps/shared/dev/display/disp_hcms29xx.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/bsps/shared/dev/display/disp_hcms29xx.c b/bsps/shared/dev/display/disp_hcms29xx.c index 5730b36ea9..740aa56b8b 100644 --- a/bsps/shared/dev/display/disp_hcms29xx.c +++ b/bsps/shared/dev/display/disp_hcms29xx.c @@ -589,10 +589,9 @@ static rtems_task disp_hcms29xx_update_task RTEMS_WAIT,RTEMS_NO_TIMEOUT); } if (rc == RTEMS_SUCCESSFUL) { - strncpy(softc_ptr->disp_param.disp_buffer, - softc_ptr->disp_param.trns_buffer, - sizeof(softc_ptr->disp_param.disp_buffer)); - softc_ptr->disp_param.disp_buffer[sizeof(softc_ptr->disp_param.disp_buffer)-1] = '\0'; + strlcpy(softc_ptr->disp_param.disp_buffer, + softc_ptr->disp_param.trns_buffer, + sizeof(softc_ptr->disp_param.disp_buffer)); softc_ptr->disp_param.disp_buf_cnt = (int) strlen(softc_ptr->disp_param.disp_buffer); } |