diff --git a/include/filehandling.h b/include/filehandling.h index 1d13097e4..db03ac456 100644 --- a/include/filehandling.h +++ b/include/filehandling.h @@ -15,8 +15,8 @@ int _wopen (const char *path, int oflag, ...); #endif -bool hc_fopen (HCFILE *fp, const char *path, char *mode); -bool hc_fopen_raw (HCFILE *fp, const char *path, char *mode); +bool hc_fopen (HCFILE *fp, const char *path, const char *mode); +bool hc_fopen_raw (HCFILE *fp, const char *path, const char *mode); int hc_fscanf (HCFILE *fp, const char *format, void *ptr); int hc_fprintf (HCFILE *fp, const char *format, ...); int hc_vfprintf (HCFILE *fp, const char *format, va_list ap); diff --git a/include/types.h b/include/types.h index ed22a95ee..9b58e6c6a 100644 --- a/include/types.h +++ b/include/types.h @@ -1075,7 +1075,7 @@ typedef struct hc_fp bool is_zip; int bom_size; - char *mode; + const char *mode; const char *path; } HCFILE; diff --git a/src/filehandling.c b/src/filehandling.c index 54ba73369..9edd1cb35 100644 --- a/src/filehandling.c +++ b/src/filehandling.c @@ -21,7 +21,7 @@ int _wopen (const char *path, int oflag, ...) } #endif -bool hc_fopen (HCFILE *fp, const char *path, char *mode) +bool hc_fopen (HCFILE *fp, const char *path, const char *mode) { if (path == NULL || mode == NULL) return false; @@ -130,7 +130,7 @@ bool hc_fopen (HCFILE *fp, const char *path, char *mode) return true; } -bool hc_fopen_raw (HCFILE *fp, const char *path, char *mode) +bool hc_fopen_raw (HCFILE *fp, const char *path, const char *mode) { if (path == NULL || mode == NULL) return false;