From 1247f597253ccec8307729ec02c0630af7732aba Mon Sep 17 00:00:00 2001 From: Jay Krell Date: Mon, 19 Feb 2018 03:43:37 -0800 Subject: [PATCH] Fix 'invalid conversion from const char* to char*' in CORD_batched_chr_proc Issue #206 (bdwgc). Add const to the variable receiving strchr() result for C++ compatibility. * cord/cordxtra.c (CORD_batched_chr_proc): Change type of occ local variable from char* to const char*; remove register keyword for occ. --- cord/cordxtra.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cord/cordxtra.c b/cord/cordxtra.c index 827b5db..97060a8 100644 --- a/cord/cordxtra.c +++ b/cord/cordxtra.c @@ -332,9 +332,9 @@ int CORD_rchr_proc(char c, void * client_data) int CORD_batched_chr_proc(const char *s, void * client_data) { register chr_data * d = (chr_data *)client_data; - register char * occ = strchr(s, d -> target); + const char * occ = strchr(s, d -> target); - if (occ == 0) { + if (NULL == occ) { d -> pos += strlen(s); return(0); } else { -- 2.7.4