Add const qualifiers to fix build with ISO C23

Fix https://github.com/wolfcw/libfaketime/issues/524
This commit is contained in:
Tomas Korbar
2025-12-15 11:03:21 +01:00
parent 1231a002e0
commit dbe865dfdb

View File

@@ -2666,7 +2666,7 @@ int timespec_get(struct timespec *ts, int base)
static void parse_ft_string(const char *user_faked_time) static void parse_ft_string(const char *user_faked_time)
{ {
struct tm user_faked_time_tm; struct tm user_faked_time_tm;
char * tmp_time_fmt; const char * tmp_time_fmt;
char * nstime_str; char * nstime_str;
if (!strncmp(user_faked_time, user_faked_time_saved, BUFFERLEN)) if (!strncmp(user_faked_time, user_faked_time_saved, BUFFERLEN))
@@ -3338,7 +3338,7 @@ static void prepare_config_contents(char *contents)
bool str_array_contains(const char *haystack, const char *needle) bool str_array_contains(const char *haystack, const char *needle)
{ {
size_t needle_len = strlen(needle); size_t needle_len = strlen(needle);
char *pos = strstr(haystack, needle); const char *pos = strstr(haystack, needle);
while (pos) { while (pos) {
if (pos == haystack || *(pos - 1) == ',') { if (pos == haystack || *(pos - 1) == ',') {
char nextc = *(pos + needle_len); char nextc = *(pos + needle_len);