From a1cbb27f3cb543ff752065c73d7bcc1191de7fbb Mon Sep 17 00:00:00 2001 From: Moritz Jodeit Date: Fri, 1 Jun 2007 20:59:05 +0000 Subject: Fix snprintf(9) truncation check and skip the check for -1 because only the libc snprintf(3) could return this. ok krw@ --- sys/scsi/ss_scanjet.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/scsi/ss_scanjet.c b/sys/scsi/ss_scanjet.c index d331491aa44..18c8a3a6f96 100644 --- a/sys/scsi/ss_scanjet.c +++ b/sys/scsi/ss_scanjet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ss_scanjet.c,v 1.30 2006/11/28 16:56:50 dlg Exp $ */ +/* $OpenBSD: ss_scanjet.c,v 1.31 2007/06/01 20:59:04 moritz Exp $ */ /* $NetBSD: ss_scanjet.c,v 1.6 1996/05/18 22:58:01 christos Exp $ */ /* @@ -444,7 +444,7 @@ scanjet_set_window(ss, flags) (int)(ss->sio.scan_brightness) - 128, (int)(ss->sio.scan_contrast) - 128); - if (n >= sizeof escape_codes || n == -1) + if (n >= sizeof escape_codes - len) return (ENOMEM); len += n; -- cgit v1.2.3