[brlcad-commits] SF.net SVN: brlcad:[49301] brlcad/trunk/src/librt/comb/db_comb.c
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <br...@us...> - 2012-02-07 09:23:41
|
Revision: 49301 http://brlcad.svn.sourceforge.net/brlcad/?rev=49301&view=rev Author: brlcad Date: 2012-02-07 09:23:31 +0000 (Tue, 07 Feb 2012) Log Message: ----------- another strncpy()-to-memcpy() conversion since we're dealing with a memory buffer instead of a string. Modified Paths: -------------- brlcad/trunk/src/librt/comb/db_comb.c Modified: brlcad/trunk/src/librt/comb/db_comb.c =================================================================== --- brlcad/trunk/src/librt/comb/db_comb.c 2012-02-07 09:21:58 UTC (rev 49300) +++ brlcad/trunk/src/librt/comb/db_comb.c 2012-02-07 09:23:31 UTC (rev 49301) @@ -267,8 +267,8 @@ tp->tr_l.tl_op = OP_DB_LEAF; /* bu_strlcpy not safe here, buffer size mismatch */ - strncpy(namebuf, rp[j+1].M.m_instname, NAMESIZE); - namebuf[NAMESIZE] = '\0'; /* sanity */ + memset(namebuf, 0, NAMESIZE+1); + memcpy(namebuf, rp[j+1].M.m_instname, sizeof(rp[j+1].M.m_instname)); tp->tr_l.tl_name = bu_strdup(namebuf); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |