diff --git a/components/lwp/terminal/freebsd/tty_pts.c b/components/lwp/terminal/freebsd/tty_pts.c index 565fb95773f8..d25e668d861c 100644 --- a/components/lwp/terminal/freebsd/tty_pts.c +++ b/components/lwp/terminal/freebsd/tty_pts.c @@ -803,7 +803,7 @@ int pts_alloc(int fflags, struct rt_thread *td, struct dfs_file *ptm_file) #else rootpath = ptyfs_get_rootpath(ptmx_device); RT_ASSERT(rootpath[strlen(rootpath) - 1] != '/'); - snprintf(name_buf, DIRENT_NAME_MAX, "%s/%u", rootpath, psc->pts_unit); + snprintf(name_buf, DIRENT_NAME_MAX, "%s/%d", rootpath, psc->pts_unit); /* setup the pts */ lwp_tty_register(tp, name_buf);