commit 29fac256faea295476e901ec581db9533bb3fe29 parent 375a47d5023c9eccf45d8142a0568824eb4ed7ab Author: Florian Dold <florian.dold@gmail.com> Date: Fri, 1 Nov 2019 17:09:52 +0100 fix path concatenation Diffstat:
| M | src/util/util.c | | | 6 | ++---- |
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/util/util.c b/src/util/util.c @@ -677,14 +677,12 @@ TALER_buffer_write_path (struct TALER_Buffer *buf, const char *str) { size_t len = strlen (str); - if (0 == len) - return; - if ('/' == str[0]) + while ( (0 != len) && ('/' == str[0]) ) { str++; len--; } - if ( (0 == buf->position) || ('/' != buf->mem[buf->position]) ) + if ( (0 == buf->position) || ('/' != buf->mem[buf->position - 1]) ) { TALER_buffer_ensure_remaining (buf, 1); buf->mem[buf->position++] = '/';