Skip to content

Commit 09deafb

Browse files
starseekercshorler
authored andcommitted
Use strncpy to initialize schName and newName
1 parent 830e29f commit 09deafb

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/clstepcore/schRename.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@
2222
class SC_CORE_EXPORT SchRename {
2323
public:
2424
SchRename( const char * sch = "\0", const char * newnm = "\0" ) : next( 0 ) {
25-
strcpy( schName, sch );
26-
strcpy( newName, newnm );
25+
strncpy( schName, sch, BUFSIZ );
26+
schName[BUFSIZ] = '\0';
27+
strncpy( newName, newnm, BUFSIZ );
28+
newName[BUFSIZ] = '\0';
2729
}
2830
~SchRename() {
2931
delete next;

0 commit comments

Comments
 (0)