From 86ffccf24f66032a89d70a32b3609584c0db7345 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Fri, 28 Jun 2019 13:32:54 +0000 Subject: When system calls indicate an error they return -1, not some arbitrary value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future. --- games/grdc/grdc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'games/grdc') diff --git a/games/grdc/grdc.c b/games/grdc/grdc.c index ea2d3408b92..64a3b1b2196 100644 --- a/games/grdc/grdc.c +++ b/games/grdc/grdc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: grdc.c,v 1.30 2019/01/06 18:27:14 tedu Exp $ */ +/* $OpenBSD: grdc.c,v 1.31 2019/06/28 13:32:52 deraadt Exp $ */ /* * * Copyright 2002 Amos Shapir. Public domain. @@ -293,7 +293,7 @@ getwinsize(int *wid, int *ht) { struct winsize size; - if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &size) < 0) { + if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &size) == -1) { *wid = 80; /* Default */ *ht = 24; } else { -- cgit v1.2.3