summaryrefslogtreecommitdiff
path: root/sys/scsi/ss_scanjet.c
diff options
context:
space:
mode:
authorMoritz Jodeit <moritz@cvs.openbsd.org>2007-06-01 20:59:05 +0000
committerMoritz Jodeit <moritz@cvs.openbsd.org>2007-06-01 20:59:05 +0000
commita1cbb27f3cb543ff752065c73d7bcc1191de7fbb (patch)
tree0c79b0ffe298abea5b64bd5579977684b4fce675 /sys/scsi/ss_scanjet.c
parent8975bdd33386bb1b22a0e25992d8f805a420121f (diff)
Fix snprintf(9) truncation check and skip the check for -1 because
only the libc snprintf(3) could return this. ok krw@
Diffstat (limited to 'sys/scsi/ss_scanjet.c')
-rw-r--r--sys/scsi/ss_scanjet.c4
1 files 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;