diff --git a/fs/jffs2/src/vfs_jffs2.c b/fs/jffs2/src/vfs_jffs2.c index e9d1eba6..a67ed280 100644 --- a/fs/jffs2/src/vfs_jffs2.c +++ b/fs/jffs2/src/vfs_jffs2.c @@ -490,14 +490,14 @@ off_t VfsJffs2Seek(struct file *filep, off_t offset, int whence) filePos = filep->f_pos; switch (whence) { - case SEEK_SET: - filePos = offset; - break; - case SEEK_CUR: filePos += offset; break; + case SEEK_SET: + filePos = offset; + break; + case SEEK_END: filePos = node->i_size + offset; break; diff --git a/kernel/extended/plimit/los_devicelimit.c b/kernel/extended/plimit/los_devicelimit.c index a4a6446e..2cebaa3b 100644 --- a/kernel/extended/plimit/los_devicelimit.c +++ b/kernel/extended/plimit/los_devicelimit.c @@ -485,29 +485,35 @@ UINT32 OsDevLimitWriteDeny(ProcLimitSet *plimit, const CHAR *buf, UINT32 size) return DevLimitUpdateAccess(plimit, buf, DEVLIMIT_DENY); } -STATIC VOID DevLimitItemSetAccess(CHAR *acc, INT16 access) +STATIC VOID DevLimitItemSetAccess(CHAR *accArray, INT16 access) { INT32 index = 0; (VOID)memset_s(acc, ACCLEN, 0, ACCLEN); if (access & DEVLIMIT_ACC_READ) { - acc[index++] = 'r'; + accArray[index] = 'r'; + index++; } if (access & DEVLIMIT_ACC_WRITE) { - acc[index++] = 'w'; + accArray[index] = 'w'; + index++; } if (access & DEVLIMIT_ACC_MKNOD) { - acc[index++] = 'm'; + accArray[index] = 'm'; + index++; } } STATIC CHAR DevLimitItemTypeToChar(INT16 type) { - if (type == DEVLIMIT_DEV_ALL) { - return 'a'; - } else if (type == DEVLIMIT_DEV_CHAR) { - return 'c'; - } else if (type == DEVLIMIT_DEV_BLOCK) { - return 'b'; + switch (type) { + case DEVLIMIT_DEV_ALL: + return 'a'; + case DEVLIMIT_DEV_CHAR: + return 'c'; + case DEVLIMIT_DEV_BLOCK: + return 'b'; + default: + break; } return 'X'; }