From: Jean Delvare Date: Fri, 9 May 2008 15:59:51 +0000 (+0200) Subject: [GFS2] Prefer strlcpy() over snprintf() X-Git-Tag: v2.6.26-rc4~102^2 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=00377d8e3842776d1da633ad9c79a16ecb548b92;p=linux-2.6-omap-h63xx.git [GFS2] Prefer strlcpy() over snprintf() strlcpy is faster than snprintf when you don't use the returned value. Signed-off-by: Jean Delvare Signed-off-by: Steven Whitehouse --- diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index ef9c6c4f80f..b2028c82e8d 100644 --- 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; - 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, '/')))