-/* $OpenBSD: cu.c,v 1.30 2023/12/21 11:25:38 jca Exp $ */
+/* $OpenBSD: cu.c,v 1.31 2024/02/10 15:29:04 deraadt Exp $ */
/*
* Copyright (c) 2012 Nicholas Marriott <nicm@openbsd.org>
size = 0;
for (;;) {
if (sysctl(mib, 2, NULL, &size, NULL, 0) == -1 || size == 0)
- err(1, "hw.ucomnames");
+ return NULL;
if ((names = realloc(names, size)) == NULL)
err(1, NULL);
if (sysctl(mib, 2, names, &size, NULL, 0) != -1)
break;
if (errno != ENOMEM)
- err(1, "hw.ucomnames");
+ return NULL;
}
return names;
}