From f40955e03cd361966f927acfaa477cfceb8930e5 Mon Sep 17 00:00:00 2001 From: Christian Göttsche Date: Wed, 29 May 2024 20:38:23 +0200 Subject: Avoid dropping const qualifier in casts Adjusts casts to void dropping const qualifiers. This helps to avoid mistakes, e.g. modifying string literals. Also use size_t for length, similar to the upstream php interfaces. --- src/sp_config_scanner.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/sp_config_scanner.h') diff --git a/src/sp_config_scanner.h b/src/sp_config_scanner.h index 71f8f7e..560ea6e 100644 --- a/src/sp_config_scanner.h +++ b/src/sp_config_scanner.h @@ -10,9 +10,9 @@ typedef enum { } sp_argtype; typedef struct { - char *kw; // keyword points directly to the parsed input text and as such is not null-terminated + const char *kw; // keyword points directly to the parsed input text and as such is not null-terminated size_t kwlen; - char *arg; // optional argument / can be not null terminated + const char *arg; // optional argument / can be not null terminated size_t arglen; sp_argtype argtype; long lineno; -- cgit v1.3