Skip to content

Commit

Permalink
COMP: Use memcpy for raw memory copy
Browse files Browse the repository at this point in the history
CID 1106738 (#1 of 1): Buffer not null terminated (BUFFER_SIZE_WARNING)

Its a good practice to use memcpy over strncpy for non-null
terminated char sequences.

Change-Id: Icd4373c0528e46f007dba5f3246eb9538ef11867
  • Loading branch information
blowekamp committed Nov 6, 2013
1 parent ec10566 commit 06af07b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Modules/Nonunit/Review/src/itkMRCImageIO.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ void MRCImageIO::UpdateHeaderFromImageIO(void)
}

// magic number
strncpy(header.cmap, magicMAP, 4);
memcpy(header.cmap, magicMAP, 4);

if ( ByteSwapper< void * >::SystemIsBigEndian() )
{
Expand Down

0 comments on commit 06af07b

Please sign in to comment.