Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 00377d8e authored by Jean Delvare's avatar Jean Delvare Committed by Steven Whitehouse
Browse files

[GFS2] Prefer strlcpy() over snprintf()



strlcpy is faster than snprintf when you don't use the returned value.

Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
parent ad99f777
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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, '/')))