From c7b78df006a6c8588bf343fcda2f78738dbb4eda Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Sat, 24 Jul 2010 02:46:04 +0200 Subject: [PATCH] Fix lingering bug, post incrementing pointers is almost never a good idea. --- src/complete.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/complete.c b/src/complete.c index 64e97f5..3ff11d1 100644 --- a/src/complete.c +++ b/src/complete.c @@ -125,12 +125,11 @@ static int SplitPath(char *path, char **dirpart, char **filepart) free(dpart); return -1; } - } - else { + } else { if ((dpart = strdup(path)) == NULL) return -1; dpart[fpart - path + 1] = '\0'; - if ((fpart = strdup(++fpart)) == NULL) { + if ((fpart = strdup(fpart + 1)) == NULL) { free(dpart); return -1; }