lease_file_remove(): replace strncpy/strncat by snprintf()

This commit is contained in:
Thomas Bernard 2018-05-01 13:04:20 +02:00
parent f6ac854f0f
commit d0e7958617
1 changed files with 1 additions and 2 deletions

View File

@ -144,8 +144,7 @@ lease_file_remove(unsigned short eport, int proto)
return -1;
}
strncpy( tmpfilename, lease_file, sizeof(tmpfilename) );
strncat( tmpfilename, "XXXXXX", sizeof(tmpfilename) - strlen(tmpfilename));
snprintf( tmpfilename, sizeof(tmpfilename), "%sXXXXXX", lease_file);
fd = fopen( lease_file, "r");
if (fd==NULL) {