diff options
author | 2020-09-02 19:57:33 +0000 | |
---|---|---|
committer | 2020-09-02 19:57:33 +0000 | |
commit | 90d78c526c8d93975e7b45feabd7221836100b96 (patch) | |
tree | 7418410df45fabcc8e655d14f81171da70afdf22 | |
parent | Check started flag before looking for capability. (diff) | |
download | wireguard-openbsd-90d78c526c8d93975e7b45feabd7221836100b96.tar.xz wireguard-openbsd-90d78c526c8d93975e7b45feabd7221836100b96.zip |
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
-rw-r--r-- | usr.sbin/vmctl/vmctl.c | 4 |
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); |