summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorRay Lai <ray@cvs.openbsd.org>2009-06-02 11:17:04 +0000
committerRay Lai <ray@cvs.openbsd.org>2009-06-02 11:17:04 +0000
commit73fcd9853954ed9ac9221f8f45e6aca98d8279a5 (patch)
tree8f2dd9e38a0e3352839a4be350bce492a9c02a61 /usr.bin
parent6496159955301f0475a2b3df0ea08e9d58a1535a (diff)
Make code clearer:
- if (hdr->size > SIZE_MAX - 1) + if (hdr->size == SIZE_MAX) OK nicm@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tmux/client-msg.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/tmux/client-msg.c b/usr.bin/tmux/client-msg.c
index bafbb1d9a45..f516c660ffb 100644
--- a/usr.bin/tmux/client-msg.c
+++ b/usr.bin/tmux/client-msg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: client-msg.c,v 1.1 2009/06/01 22:58:49 nicm Exp $ */
+/* $OpenBSD: client-msg.c,v 1.2 2009/06/02 11:17:03 ray Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -73,7 +73,7 @@ client_msg_dispatch(struct client_ctx *cctx, char **error)
int
client_msg_fn_error(struct hdr *hdr, struct client_ctx *cctx, char **error)
{
- if (hdr->size > SIZE_MAX - 1)
+ if (hdr->size == SIZE_MAX)
fatalx("bad MSG_ERROR size");
*error = xmalloc(hdr->size + 1);