summaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
Diffstat (limited to 'refs.c')
-rw-r--r--refs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/refs.c b/refs.c
index a415131..598f4eb 100644
--- a/refs.c
+++ b/refs.c
@@ -2607,8 +2607,8 @@ static int delete_ref_loose(struct ref_lock *lock, int flag)
* lockfile name, minus ".lock":
*/
char *loose_filename = xmemdupz(
- lock->lk->filename,
- strlen(lock->lk->filename) - LOCK_SUFFIX_LEN);
+ lock->lk->filename.buf,
+ lock->lk->filename.len - LOCK_SUFFIX_LEN);
int err = unlink_or_warn(loose_filename);
free(loose_filename);
if (err && errno != ENOENT)
@@ -2972,7 +2972,7 @@ int write_ref_sha1(struct ref_lock *lock,
write_in_full(lock->lock_fd, &term, 1) != 1 ||
close_ref(lock) < 0) {
int save_errno = errno;
- error("Couldn't write %s", lock->lk->filename);
+ error("Couldn't write %s", lock->lk->filename.buf);
unlock_ref(lock);
errno = save_errno;
return -1;