mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
[GFS2] Prefer strlcpy() over snprintf()
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>
This commit is contained in:
parent
ad99f77778
commit
00377d8e38
1 changed files with 2 additions and 2 deletions
|
@ -142,8 +142,8 @@ static int init_names(struct gfs2_sbd *sdp, int silent)
|
|||
if (!table[0])
|
||||
table = sdp->sd_vfs->s_id;
|
||||
|
||||
snprintf(sdp->sd_proto_name, GFS2_FSNAME_LEN, "%s", proto);
|
||||
snprintf(sdp->sd_table_name, GFS2_FSNAME_LEN, "%s", table);
|
||||
strlcpy(sdp->sd_proto_name, proto, GFS2_FSNAME_LEN);
|
||||
strlcpy(sdp->sd_table_name, table, GFS2_FSNAME_LEN);
|
||||
|
||||
table = sdp->sd_table_name;
|
||||
while ((table = strchr(table, '/')))
|
||||
|
|
Loading…
Reference in a new issue