diff options
author | Florian Dold <florian.dold@gmail.com> | 2019-11-01 17:09:52 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2019-11-01 17:09:52 +0100 |
commit | 29fac256faea295476e901ec581db9533bb3fe29 (patch) | |
tree | 458d7a1c9f976b1ccdb890cd9acbb7b4be0b9b89 | |
parent | 375a47d5023c9eccf45d8142a0568824eb4ed7ab (diff) | |
download | exchange-29fac256faea295476e901ec581db9533bb3fe29.tar.gz exchange-29fac256faea295476e901ec581db9533bb3fe29.zip |
fix path concatenation
-rw-r--r-- | src/util/util.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/util/util.c b/src/util/util.c index 42977a16c..10d5d53f7 100644 --- 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) | |||
677 | { | 677 | { |
678 | size_t len = strlen (str); | 678 | size_t len = strlen (str); |
679 | 679 | ||
680 | if (0 == len) | 680 | while ( (0 != len) && ('/' == str[0]) ) |
681 | return; | ||
682 | if ('/' == str[0]) | ||
683 | { | 681 | { |
684 | str++; | 682 | str++; |
685 | len--; | 683 | len--; |
686 | } | 684 | } |
687 | if ( (0 == buf->position) || ('/' != buf->mem[buf->position]) ) | 685 | if ( (0 == buf->position) || ('/' != buf->mem[buf->position - 1]) ) |
688 | { | 686 | { |
689 | TALER_buffer_ensure_remaining (buf, 1); | 687 | TALER_buffer_ensure_remaining (buf, 1); |
690 | buf->mem[buf->position++] = '/'; | 688 | buf->mem[buf->position++] = '/'; |