From 4daa584b7d499cb6f1b7a873247b56b7f8cfb74d Mon Sep 17 00:00:00 2001 From: Neil Rickards Date: Mon, 26 Feb 2018 00:07:53 +0100 Subject: [PATCH] Update nominatim.c --- module/nominatim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/nominatim.c b/module/nominatim.c index a0d8c5ae..73bf16c8 100644 --- a/module/nominatim.c +++ b/module/nominatim.c @@ -168,7 +168,7 @@ void str_replace(char* buffer, int* len, int* changes, char* from, int fromlen, p = strstr(buffer, from); while(p) { - if (!isspace || p == buffer || *(p-1) != ' ') + if (!isspace || (p > buffer && *(p-1) != ' ')) { (*changes)++; if (tolen != fromlen) memmove(p+tolen, p+fromlen, *len-(p-buffer)+1);