summaryrefslogtreecommitdiffstats
path: root/src/statoverride
diff options
context:
space:
mode:
Diffstat (limited to 'src/statoverride')
-rw-r--r--src/statoverride/main.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/statoverride/main.c b/src/statoverride/main.c
index 07c8757..1ba091f 100644
--- a/src/statoverride/main.c
+++ b/src/statoverride/main.c
@@ -26,7 +26,7 @@
#include <sys/stat.h>
#include <errno.h>
-#if HAVE_LOCALE_H
+#ifdef HAVE_LOCALE_H
#include <locale.h>
#endif
#include <string.h>
@@ -280,14 +280,13 @@ statoverride_add(const char *const *argv)
varbuf_add_str(&realfilename, dpkg_fsys_get_dir());
varbuf_add_str(&realfilename, filename);
- varbuf_end_str(&realfilename);
- if (stat(realfilename.buf, &st) == 0) {
+ if (stat(varbuf_str(&realfilename), &st) == 0) {
(*filestat)->mode |= st.st_mode & S_IFMT;
- statdb_node_apply(realfilename.buf, *filestat);
+ statdb_node_apply(varbuf_str(&realfilename), *filestat);
} else if (opt_verbose) {
warning(_("--update given but %s does not exist"),
- realfilename.buf);
+ varbuf_str(&realfilename));
}
varbuf_destroy(&realfilename);