Commit 5b1c7ef3 authored by Mark Andrews's avatar Mark Andrews
Browse files

4264. [bug] Check const of strchr/strrchr assignments match

                        argument's const status. [RT #41150]
parent 913d976e
......@@ -226,8 +226,9 @@ isc_file_mktemplate(const char *path, char *buf, size_t buflen) {
isc_result_t
isc_file_template(const char *path, const char *templet, char *buf,
size_t buflen) {
char *s;
size_t buflen)
{
const char *s;
REQUIRE(path != NULL);
REQUIRE(templet != NULL);
......@@ -285,7 +286,7 @@ isc_file_renameunique(const char *file, char *templet) {
if (errno != EEXIST)
return (isc__errno2result(errno));
for (cp = x;;) {
char *t;
const char *t;
if (*cp == '\0')
return (ISC_R_FAILURE);
t = strchr(alphnum, *cp);
......@@ -503,7 +504,7 @@ isc_file_ischdiridempotent(const char *filename) {
const char *
isc_file_basename(const char *filename) {
char *s;
const char *s;
REQUIRE(filename != NULL);
......@@ -621,9 +622,11 @@ isc_file_safecreate(const char *filename, FILE **fp) {
}
isc_result_t
isc_file_splitpath(isc_mem_t *mctx, char *path, char **dirname, char **basename)
isc_file_splitpath(isc_mem_t *mctx, const char *path, char **dirname,
char const **basename)
{
char *dir, *file, *slash;
char *dir;
const char *file, *slash;
if (path == NULL)
return (ISC_R_INVALIDFILE);
......
......@@ -325,7 +325,8 @@ isc_file_mktemplate(const char *path, char *buf, size_t buflen) {
isc_result_t
isc_file_template(const char *path, const char *templet, char *buf,
size_t buflen) {
size_t buflen)
{
char *s;
REQUIRE(path != NULL);
......@@ -588,7 +589,7 @@ isc_file_basename(const char *filename) {
isc_result_t
isc_file_progname(const char *filename, char *progname, size_t namelen) {
const char *s;
char *p;
const char *p;
size_t len;
REQUIRE(filename != NULL);
......@@ -700,9 +701,11 @@ isc_file_safecreate(const char *filename, FILE **fp) {
}
isc_result_t
isc_file_splitpath(isc_mem_t *mctx, char *path, char **dirname, char **basename)
isc_file_splitpath(isc_mem_t *mctx, const char *path, char **dirname,
char const ** basename)
{
char *dir, *file, *slash;
char *dir;
const char *file, *slash;
char *backslash;
slash = strrchr(path, '/');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment