diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2007-10-03 12:34:16 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2007-10-03 12:34:16 +0000 |
commit | fe06744d66e66b0b8e3839dbca5791001be5e58d (patch) | |
tree | 8dc1240b8d30e8ccd85fc2fd6b58633ec7dc349e /server-fn.c | |
parent | dadc56d754f2e86dec96bcf3bed54090538ce336 (diff) |
String/number arguments..
Diffstat (limited to 'server-fn.c')
-rw-r--r-- | server-fn.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/server-fn.c b/server-fn.c index 8048e8b7..f46a4715 100644 --- a/server-fn.c +++ b/server-fn.c @@ -1,4 +1,4 @@ -/* $Id: server-fn.c,v 1.12 2007-10-03 10:18:32 nicm Exp $ */ +/* $Id: server-fn.c,v 1.13 2007-10-03 12:34:16 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -230,6 +230,8 @@ server_write_message(struct client *c, const char *fmt, ...) va_start(ap, fmt); xvasprintf(&msg, fmt, ap); va_end(ap); + if (strlen(msg) > c->sx - 1) + msg[c->sx - 1] = '\0'; buffer_write(c->out, msg, strlen(msg)); for (i = strlen(msg); i < c->sx; i++) input_store8(c->out, ' '); |