diff options
author | Joseph Herlant <aerostitch@debian.org> | 2019-10-22 00:37:48 -0700 |
---|---|---|
committer | Joseph Herlant <aerostitch@debian.org> | 2019-10-22 00:37:48 -0700 |
commit | 1cecebf85ca4ae8ca152a3e8169a7ebc5ff8a368 (patch) | |
tree | 23ddbdb5884a8ec8428d5b19a5fe33368ac45e3a | |
parent | 39707705c154276e098accb551aa03d22c5fb7ee (diff) | |
download | navit-1cecebf85ca4ae8ca152a3e8169a7ebc5ff8a368.tar.gz |
Handle case when the string will only contain chars that will be discarded
-rw-r--r-- | navit/search.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/navit/search.c b/navit/search.c index 62eb37dce..e700f4355 100644 --- a/navit/search.c +++ b/navit/search.c @@ -167,6 +167,9 @@ char *search_fix_spaces(const char *str) { len--; } } while (c); + // Make sure the string is terminated at current position even if nothing has been added to it. + // This case happen when you use a string containing only chars that will be discarded. + *d='\0'; return ret; } |