1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-01 01:17:02 +00:00
freebsd-ports/japanese/epic4/files/patch-server.c
2000-12-05 12:04:46 +00:00

33 lines
1.1 KiB
C

--- epic4-0.9.9/source/server.c.orig Fri Sep 29 03:16:55 2000
+++ epic4-0.9.9/source/server.c Mon Dec 4 03:44:17 2000
@@ -826,6 +826,7 @@
char buffer[BIG_BUFFER_SIZE * 3 + 1]; /* make this buffer *much*
* bigger than needed */
size_t size = BIG_BUFFER_SIZE * 3;
+ char jis_buffer[BIG_BUFFER_SIZE + 1];
int len,
des;
int server;
@@ -845,16 +846,18 @@
yell("mangle_line truncated results! Ick.");
}
+ Euc2Jis(buffer, jis_buffer, IRCD_BUFFER_SIZE -2);
+ len = strlen(jis_buffer);
server_list[server].sent = 1;
if (len > (IRCD_BUFFER_SIZE - 2) || len == -1)
buffer[IRCD_BUFFER_SIZE - 2] = 0;
if (x_debug & DEBUG_OUTBOUND)
yell("[%d] -> [%s]", des, buffer);
- strmcat(buffer, "\r\n", IRCD_BUFFER_SIZE);
+ strmcat(jis_buffer, "\r\n", IRCD_BUFFER_SIZE);
if (do_hook(SEND_TO_SERVER_LIST, "%d %d %s",
- server, des, buffer))
+ server, des, jis_buffer))
{
- if (write(des, buffer, strlen(buffer)) == -1 &&
+ if (write(des, jis_buffer, strlen(jis_buffer)) == -1 &&
(!get_int_var(NO_FAIL_DISCONNECT_VAR)))
{
server_list[server].save_channels = 1;