diff options
| author | nulltoken <emeric.fermas@gmail.com> | 2011-03-19 08:31:40 +0100 |
|---|---|---|
| committer | Vicent Marti <tanoku@gmail.com> | 2011-03-23 00:25:04 +0200 |
| commit | 2b861d7589467734c2371c4daaab6e540857b988 (patch) | |
| tree | 6b68b757a931acfdf03ff1c80de76e0a41fd220c /src/util.c | |
| parent | f428ae615b4386e78cb337386b3d8e190e921766 (diff) | |
| download | libgit2-2b861d7589467734c2371c4daaab6e540857b988.tar.gz | |
Add detection of incorrect usage to git__joinpath()
Diffstat (limited to 'src/util.c')
| -rw-r--r-- | src/util.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c index bfc4f7b27..995daf314 100644 --- a/src/util.c +++ b/src/util.c @@ -223,6 +223,9 @@ void git__joinpath_n(char *buffer_out, int count, ...) int len; path = va_arg(ap, const char *); + + assert((i == 0) || path != buffer_start); + if (i > 0 && *path == '/' && buffer_out > buffer_start && buffer_out[-1] == '/') path++; |
