Update nominatim.c

This commit is contained in:
Neil Rickards 2018-02-26 00:07:53 +01:00 committed by GitHub
parent 8ee36fb78c
commit 4daa584b7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View 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);