chore: use size_t for indexing and iterating

This commit is contained in:
2024-12-25 20:22:28 +01:00
parent e13a8ff79c
commit f34a71195e
6 changed files with 13 additions and 12 deletions

View File

@@ -26,7 +26,7 @@ int chvt_str(char *str) {
int chvt(int n) {
fprintf(stderr, "activating vt %d\n", n);
char c = 0;
for (int i = 0; i < sizeof(vterms) / sizeof(vterms[0]); i++) {
for (size_t i = 0; i < sizeof(vterms) / sizeof(vterms[0]); i++) {
int fd = open(vterms[i], O_RDWR);
if (fd >= 0 && isatty(fd) && ioctl(fd, KDGKBTYPE, &c) == 0 && c < 3) {
if (ioctl(fd, VT_ACTIVATE, n) < 0 || ioctl(fd, VT_WAITACTIVE, n) < 0) {