diff options
Diffstat (limited to '')
-rw-r--r-- | TODO | 1 | ||||
-rw-r--r-- | set-contact-photos.c | 7 |
2 files changed, 3 insertions, 5 deletions
@@ -11,7 +11,6 @@ Test list-chat-contacts Test list-contact-organisations Test list-organisation-contacts Test set-contact-blocks -Test set-contact-photos Test unblock-contact Add ability to filter on unset values in entries Add ability to remove values in entries diff --git a/set-contact-photos.c b/set-contact-photos.c index 51366dd..744e8a2 100644 --- a/set-contact-photos.c +++ b/set-contact-photos.c @@ -60,9 +60,9 @@ again: } else if (r[0] == '/' && r[1] == '.' && r[2] == '.' && (r[3] == '/' || !r[3])) { *w = '\0'; target = get_target(ret, &targetlen); + *w = '/'; if (!target) { - while (w[-1] != '/') - w--; + while (*--w != '/'); r += 3; } else if (!target[0]) { eprintf("%s: encountered symlink with empty target\n", path); @@ -86,8 +86,7 @@ again: errno = ELOOP; eprintf("%s:", path); } - while (w[-1] != '/') - w--; + while (*--w != '/'); len1 = (size_t)(w - ret); len2 = targetlen; len3 = retlennul - (size_t)(r - ret); |