Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
2f8416db
Commit
2f8416db
authored
Mar 10, 2005
by
Trond Myklebust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NFS: Use sizeof() instead of strlen() on string constants.
Signed-off-by:
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
parent
bb13f3d0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
fs/nfs/dir.c
fs/nfs/dir.c
+1
-1
fs/nfs/nfsroot.c
fs/nfs/nfsroot.c
+2
-2
No files found.
fs/nfs/dir.c
View file @
2f8416db
...
...
@@ -1107,7 +1107,7 @@ static int nfs_sillyrename(struct inode *dir, struct dentry *dentry)
static
unsigned
int
sillycounter
;
const
int
i_inosize
=
sizeof
(
dir
->
i_ino
)
*
2
;
const
int
countersize
=
sizeof
(
sillycounter
)
*
2
;
const
int
slen
=
s
trlen
(
".nfs"
)
+
i_inosize
+
countersize
;
const
int
slen
=
s
izeof
(
".nfs"
)
+
i_inosize
+
countersize
-
1
;
char
silly
[
slen
+
1
];
struct
qstr
qsilly
;
struct
dentry
*
sdentry
;
...
...
fs/nfs/nfsroot.c
View file @
2f8416db
...
...
@@ -385,9 +385,9 @@ int __init nfs_root_setup(char *line)
if
(
line
[
0
]
==
'/'
||
line
[
0
]
==
','
||
(
line
[
0
]
>=
'0'
&&
line
[
0
]
<=
'9'
))
{
strlcpy
(
nfs_root_name
,
line
,
sizeof
(
nfs_root_name
));
}
else
{
int
n
=
strlen
(
line
)
+
s
trlen
(
NFS_ROOT
)
;
int
n
=
strlen
(
line
)
+
s
izeof
(
NFS_ROOT
)
-
1
;
if
(
n
>=
sizeof
(
nfs_root_name
))
line
[
sizeof
(
nfs_root_name
)
-
s
trlen
(
NFS_ROOT
)
-
1
]
=
'\0'
;
line
[
sizeof
(
nfs_root_name
)
-
s
izeof
(
NFS_ROOT
)
-
2
]
=
'\0'
;
sprintf
(
nfs_root_name
,
NFS_ROOT
,
line
);
}
root_server_addr
=
root_nfs_parse_addr
(
nfs_root_name
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment