projects
/
GitHub
/
LineageOS
/
G12
/
android_kernel_amlogic_linux-4.9.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ad99f77
)
[GFS2] Prefer strlcpy() over snprintf()
author
Jean Delvare
<khali@linux-fr.org>
Fri, 9 May 2008 15:59:51 +0000
(17:59 +0200)
committer
Steven Whitehouse
<swhiteho@redhat.com>
Mon, 12 May 2008 07:57:11 +0000
(08:57 +0100)
strlcpy is faster than snprintf when you don't use the returned value.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
fs/gfs2/ops_fstype.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/gfs2/ops_fstype.c
b/fs/gfs2/ops_fstype.c
index ef9c6c4f80f6cb420ba539e26a601240bbb49183..b2028c82e8d1ae53fc04672303ce4e14fa3d7276 100644
(file)
--- a/
fs/gfs2/ops_fstype.c
+++ b/
fs/gfs2/ops_fstype.c
@@
-142,8
+142,8
@@
static int init_names(struct gfs2_sbd *sdp, int silent)
if (!table[0])
table = sdp->sd_vfs->s_id;
- s
nprintf(sdp->sd_proto_name, GFS2_FSNAME_LEN, "%s", proto
);
- s
nprintf(sdp->sd_table_name, GFS2_FSNAME_LEN, "%s", table
);
+ s
trlcpy(sdp->sd_proto_name, proto, GFS2_FSNAME_LEN
);
+ s
trlcpy(sdp->sd_table_name, table, GFS2_FSNAME_LEN
);
table = sdp->sd_table_name;
while ((table = strchr(table, '/')))