summaryrefslogtreecommitdiff
path: root/usr.sbin/vmctl
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2020-09-02 19:57:34 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2020-09-02 19:57:34 +0000
commitdaf0537f196dfe9c78735ac5424c1f03e4a7fc4f (patch)
treed3e802eca0b37e2a6f4bda106df4b67885bdc988 /usr.sbin/vmctl
parent0c125e35cb4d66d7ece86de0496505781359e29b (diff)
Fix clang warning in vmctl(8)
If the path to a tty doesn't contain a '/' or ends in a '/' use the full path. (The intent is to chop off the leading "/dev/") ok deraadt (who had the same diff) martijn millert
Diffstat (limited to 'usr.sbin/vmctl')
-rw-r--r--usr.sbin/vmctl/vmctl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/vmctl/vmctl.c b/usr.sbin/vmctl/vmctl.c
index dcded076005..1e99f13508d 100644
--- a/usr.sbin/vmctl/vmctl.c
+++ b/usr.sbin/vmctl/vmctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmctl.c,v 1.74 2020/03/11 12:47:49 jasper Exp $ */
+/* $OpenBSD: vmctl.c,v 1.75 2020/09/02 19:57:33 tb Exp $ */
/*
* Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org>
@@ -789,7 +789,7 @@ print_vm_info(struct vmop_info_result *list, size_t ct)
tty = "-";
/* get tty - skip /dev/ path */
else if ((tty = strrchr(vmi->vir_ttyname,
- '/')) == NULL || ++tty == '\0')
+ '/')) == NULL || *++tty == '\0')
tty = list[i].vir_ttyname;
(void)fmt_scaled(vir->vir_used_size, curmem);