Skip to content

Commit

Permalink
Replace strncpy usage in favor of Strlcpy to get rid of compiler warn…
Browse files Browse the repository at this point in the history
…ings.
  • Loading branch information
thor2016 committed Jun 9, 2024
1 parent ecbfca1 commit eecb2e7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ld65dbg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include "types.h"
#include "ld65dbg.h"
#include "utils/StringUtils.h"


namespace ld65
Expand Down Expand Up @@ -304,7 +305,7 @@ namespace ld65
}
else if ( strcmp( key, "name") == 0 )
{
strncpy( name, val, sizeof(name));
Strlcpy( name, val, sizeof(name));
}
else if ( strcmp( key, "size") == 0 )
{
Expand Down Expand Up @@ -332,7 +333,7 @@ namespace ld65
}
else if ( strcmp( key, "type") == 0 )
{
strncpy( type, val, sizeof(type));
Strlcpy( type, val, sizeof(type));
}
}

Expand Down

0 comments on commit eecb2e7

Please sign in to comment.