mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-03 17:54:33 +03:00
remove use of strcpy
This commit is contained in:
parent
9142bab736
commit
912aa3774e
@ -165,7 +165,7 @@ filepath_sfinddef(char **respathv,
|
||||
snprintf(t, PATH_MAX, "%s/%s", def, filename);
|
||||
}
|
||||
if (realpath(t, ret) == NULL) {
|
||||
strcpy(ret, t);
|
||||
strncpy(ret, t, PATH_MAX);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -69,10 +69,10 @@ char *filepath_findfile(const char *format, ...);
|
||||
* normalised file name of the first acessible file or NULL if no file
|
||||
* can be found in any of the resource paths.
|
||||
*
|
||||
* @param respathv The resource path vector to iterate.
|
||||
* @param filepath The buffer to place the result in.
|
||||
* @param filename The filename of the resource to search for.
|
||||
* @return A pointer to filepath if a target is found or NULL if not.
|
||||
* \param respathv The resource path vector to iterate.
|
||||
* \param filepath The buffer to place the result in.
|
||||
* \param filename The filename of the resource to search for.
|
||||
* \return A pointer to filepath if a target is found or NULL if not.
|
||||
*/
|
||||
char *filepath_sfind(char **respathv, char *filepath, const char *filename);
|
||||
|
||||
@ -93,6 +93,12 @@ char *filepath_find(char **respathv, const char *filename);
|
||||
* is used as an additional path element to search, if that still
|
||||
* fails the returned path is set to the concatination of the default
|
||||
* path and the filename.
|
||||
*
|
||||
* \param respathv The resource path vector to iterate.
|
||||
* \param filepath The buffer to place the result in. Must have space for PATH_MAX bytes.
|
||||
* \param filename The filename of the resource to search for.
|
||||
* \param def The default path to use
|
||||
* \return A pointer to filepath if a target is found or the default if not
|
||||
*/
|
||||
char *filepath_sfinddef(char **respathv, char *filepath, const char *filename,
|
||||
const char *def);
|
||||
|
Loading…
Reference in New Issue
Block a user