diff --git a/fs/qnx6/inode.c b/fs/qnx6/inode.c index a286c545717f..69ee2d4ffe9e 100644 --- a/fs/qnx6/inode.c +++ b/fs/qnx6/inode.c @@ -178,8 +178,7 @@ static int qnx6_statfs(struct dentry *dentry, struct kstatfs *buf) */ static const char *qnx6_checkroot(struct super_block *s) { - static char match_root[2][3] = {".\0\0", "..\0"}; - int i, error = 0; + int error = 0; struct qnx6_dir_entry *dir_entry; struct inode *root = d_inode(s->s_root); struct address_space *mapping = root->i_mapping; @@ -188,11 +187,9 @@ static const char *qnx6_checkroot(struct super_block *s) return "error reading root directory"; kmap(page); dir_entry = page_address(page); - for (i = 0; i < 2; i++) { - /* maximum 3 bytes - due to match_root limitation */ - if (strncmp(dir_entry[i].de_fname, match_root[i], 3)) - error = 1; - } + if (memcmp(dir_entry[0].de_fname, ".", 2) || + memcmp(dir_entry[1].de_fname, "..", 3)) + error = 1; qnx6_put_page(page); if (error) return "error reading root directory.";