lease_file_remove(): replace strncpy/strncat by snprintf()
This commit is contained in:
parent
f6ac854f0f
commit
d0e7958617
|
@ -144,8 +144,7 @@ lease_file_remove(unsigned short eport, int proto)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
strncpy( tmpfilename, lease_file, sizeof(tmpfilename) );
|
snprintf( tmpfilename, sizeof(tmpfilename), "%sXXXXXX", lease_file);
|
||||||
strncat( tmpfilename, "XXXXXX", sizeof(tmpfilename) - strlen(tmpfilename));
|
|
||||||
|
|
||||||
fd = fopen( lease_file, "r");
|
fd = fopen( lease_file, "r");
|
||||||
if (fd==NULL) {
|
if (fd==NULL) {
|
||||||
|
|
Loading…
Reference in New Issue