]> git.openstreetmap.org Git - nominatim.git/commitdiff
Update nominatim.c
authorNeil Rickards <neilrickards@gmail.com>
Sun, 25 Feb 2018 23:07:53 +0000 (00:07 +0100)
committerGitHub <noreply@github.com>
Sun, 25 Feb 2018 23:07:53 +0000 (00:07 +0100)
module/nominatim.c

index a0d8c5aeb33d2fbf628d3eab1c0072ece4f59158..73bf16c8df487eac4d462621fe566534e6476621 100644 (file)
@@ -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);