-/* $OpenBSD: editor.c,v 1.377 2022/11/08 17:52:11 krw Exp $ */
+/* $OpenBSD: editor.c,v 1.378 2022/11/09 15:17:28 krw Exp $ */
/*
* Copyright (c) 1997-2000 Todd C. Miller <millert@openbsd.org>
{ "hd", "HP-IB" },
{ "vnd", "VND" },
{ "svnd", "VND" },
- { NULL, NULL }
};
if ((s = basename(dev)) != NULL) {
i = strcspn(s, "0123456789");
s[i] = '\0';
dev = s;
- for (i = 0; dtypes[i].dev != NULL; i++) {
+ for (i = 0; i < nitems(dtypes); i++) {
if (strcmp(dev, dtypes[i].dev) == 0) {
def = dtypes[i].type;
break;