Don't use [4] since they are confusing and use the right size for memset. DOH.

This commit is contained in:
Nicholas Marriott 2009-01-17 18:38:12 +00:00
parent d5820171b7
commit ff61eee294
3 changed files with 9 additions and 9 deletions

View File

@ -1,4 +1,4 @@
# $Id: Makefile,v 1.94 2009-01-15 19:27:31 nicm Exp $ # $Id: Makefile,v 1.95 2009-01-17 18:38:12 nicm Exp $
.SUFFIXES: .c .o .y .h .SUFFIXES: .c .o .y .h
.PHONY: clean update-index.html upload-index.html .PHONY: clean update-index.html upload-index.html
@ -47,7 +47,7 @@ SRCS= tmux.c server.c server-msg.c server-fn.c buffer.c buffer-poll.c status.c \
CC?= cc CC?= cc
INCDIRS+= -I. -I- -I/usr/local/include INCDIRS+= -I. -I- -I/usr/local/include
CFLAGS+= -O0 -DMETA="'${META}'" CFLAGS+= -DMETA="'${META}'"
.ifdef PROFILE .ifdef PROFILE
# Don't use ccache # Don't use ccache
CC= /usr/bin/gcc CC= /usr/bin/gcc

6
tmux.h
View File

@ -1,4 +1,4 @@
/* $Id: tmux.h,v 1.235 2009-01-15 19:27:31 nicm Exp $ */ /* $Id: tmux.h,v 1.236 2009-01-17 18:38:12 nicm Exp $ */
/* /*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -1463,8 +1463,8 @@ int session_select(struct session *, int);
int session_last(struct session *); int session_last(struct session *);
/* utf8.c */ /* utf8.c */
u_int utf8_combine(const u_char [4]); u_int utf8_combine(const u_char *);
void utf8_split(u_int, u_char [4]); void utf8_split(u_int, u_char *);
int utf8_width(u_int); int utf8_width(u_int);
/* buffer.c */ /* buffer.c */

8
utf8.c
View File

@ -1,4 +1,4 @@
/* $Id: utf8.c,v 1.2 2008-09-25 20:08:56 nicm Exp $ */ /* $Id: utf8.c,v 1.3 2009-01-17 18:38:12 nicm Exp $ */
/* /*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net> * Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@ -23,7 +23,7 @@
#include "tmux.h" #include "tmux.h"
u_int u_int
utf8_combine(const u_char data[4]) utf8_combine(const u_char *data)
{ {
u_int uv; u_int uv;
@ -46,9 +46,9 @@ utf8_combine(const u_char data[4])
} }
void void
utf8_split(u_int uv, u_char data[4]) utf8_split(u_int uv, u_char *data)
{ {
memset(data, 0xff, sizeof data); memset(data, 0xff, 4);
if (uv <= 0x7f) if (uv <= 0x7f)
data[0] = uv; data[0] = uv;