mirror of
https://github.com/tmate-io/tmate.git
synced 2025-02-08 22:40:02 +01:00
Sync to OpenBSD: fixes from ray@.
This commit is contained in:
parent
0fdd47660a
commit
32398b98a8
6
arg.c
6
arg.c
@ -1,4 +1,4 @@
|
|||||||
/* $Id: arg.c,v 1.5 2008-08-28 17:45:25 nicm Exp $ */
|
/* $Id: arg.c,v 1.6 2009-06-25 15:25:45 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -76,7 +76,7 @@ arg_parse_client(const char *arg)
|
|||||||
|
|
||||||
/* Trim a trailing : if any from the argument. */
|
/* Trim a trailing : if any from the argument. */
|
||||||
n = strlen(arg2);
|
n = strlen(arg2);
|
||||||
if (arg2[n - 1] == ':')
|
if (n && arg2[n - 1] == ':')
|
||||||
arg2[n - 1] = '\0';
|
arg2[n - 1] = '\0';
|
||||||
|
|
||||||
/* Try and look up the client name. */
|
/* Try and look up the client name. */
|
||||||
@ -101,7 +101,7 @@ arg_parse_session(const char *arg)
|
|||||||
|
|
||||||
/* Trim a trailing : if any from the argument. */
|
/* Trim a trailing : if any from the argument. */
|
||||||
n = strlen(arg2);
|
n = strlen(arg2);
|
||||||
if (arg2[n - 1] == ':')
|
if (n && arg2[n - 1] == ':')
|
||||||
arg2[n - 1] = '\0';
|
arg2[n - 1] = '\0';
|
||||||
|
|
||||||
/* See if the argument matches a session. */
|
/* See if the argument matches a session. */
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $Id: attributes.c,v 1.1 2009-01-27 20:22:33 nicm Exp $ */
|
/* $Id: attributes.c,v 1.2 2009-06-25 15:25:45 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2009 Joshua Elsasser <josh@elsasser.org>
|
* Copyright (c) 2009 Joshua Elsasser <josh@elsasser.org>
|
||||||
@ -45,6 +45,7 @@ attributes_tostring(u_char ch)
|
|||||||
strlcat(buf, "hidden,", sizeof (buf));
|
strlcat(buf, "hidden,", sizeof (buf));
|
||||||
if (ch & GRID_ATTR_ITALICS)
|
if (ch & GRID_ATTR_ITALICS)
|
||||||
strlcat(buf, "italics,", sizeof (buf));
|
strlcat(buf, "italics,", sizeof (buf));
|
||||||
|
if (*buf)
|
||||||
*(strrchr(buf, ',')) = '\0';
|
*(strrchr(buf, ',')) = '\0';
|
||||||
|
|
||||||
return (buf);
|
return (buf);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $Id: client-msg.c,v 1.18 2009-01-21 22:47:31 nicm Exp $ */
|
/* $Id: client-msg.c,v 1.19 2009-06-25 15:25:45 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -73,7 +73,7 @@ client_msg_dispatch(struct client_ctx *cctx, char **error)
|
|||||||
int
|
int
|
||||||
client_msg_fn_error(struct hdr *hdr, struct client_ctx *cctx, char **error)
|
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");
|
fatalx("bad MSG_ERROR size");
|
||||||
|
|
||||||
*error = xmalloc(hdr->size + 1);
|
*error = xmalloc(hdr->size + 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user