提交 e0402669 编写于 作者: G goprife@gmail.com

fix bug in f_seekdir in elm fatfs, with the patch provided by rogerz.zhang@gmail.com

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2198 bbd45198-f89e-11dd-88c7-29a3b14d5316
上级 d402cfea
......@@ -3033,10 +3033,22 @@ FRESULT f_seekdir(
int offset /* the seek offset */
)
{
return dir_sdi(dj, offset); /* seek directory index to offset */
int i = 0;
if (dir_sdi(dj, 0) != FR_OK || offset < 0)
return FR_INT_ERR;
while(i < offset)
{
if(dir_read(dj) != FR_OK || dir_next(dj, 0) != FR_OK)
return FR_INT_ERR;
i++;
}
return FR_OK;
}
#if _FS_MINIMIZE == 0
/*-----------------------------------------------------------------------*/
/* Get File Status */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册