Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libcurses to initialize mbstate_t, use memset instead mb...
details: https://anonhg.NetBSD.org/src/rev/ef4c8f649dee
branches: trunk
changeset: 758987:ef4c8f649dee
user: tnozaki <tnozaki%NetBSD.org@localhost>
date: Tue Nov 23 05:38:35 2010 +0000
description:
to initialize mbstate_t, use memset instead mbrtowc.
diffstat:
lib/libcurses/addbytes.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diffs (41 lines):
diff -r ef4ff38aaf9e -r ef4c8f649dee lib/libcurses/addbytes.c
--- a/lib/libcurses/addbytes.c Tue Nov 23 04:36:09 2010 +0000
+++ b/lib/libcurses/addbytes.c Tue Nov 23 05:38:35 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: addbytes.c,v 1.36 2010/02/23 19:48:26 drochner Exp $ */
+/* $NetBSD: addbytes.c,v 1.37 2010/11/23 05:38:35 tnozaki Exp $ */
/*
* Copyright (c) 1987, 1993, 1994
@@ -34,11 +34,12 @@
#if 0
static char sccsid[] = "@(#)addbytes.c 8.4 (Berkeley) 5/4/94";
#else
-__RCSID("$NetBSD: addbytes.c,v 1.36 2010/02/23 19:48:26 drochner Exp $");
+__RCSID("$NetBSD: addbytes.c,v 1.37 2010/11/23 05:38:35 tnozaki Exp $");
#endif
#endif /* not lint */
#include <stdlib.h>
+#include <string.h>
#include "curses.h"
#include "curses_private.h"
#ifdef DEBUG
@@ -129,7 +130,7 @@
lp = win->alines[y];
#ifdef HAVE_WCHAR
- (void)mbrtowc(NULL, NULL, (size_t)0, &st);
+ (void)memset(&st, 0, sizeof(st));
#endif
while (count > 0) {
#ifndef HAVE_WCHAR
@@ -156,7 +157,7 @@
/* not a valid conversion just eat a char */
wc = *bytes;
n = 1;
- (void)mbrtowc(NULL, NULL, (size_t)0, &st);
+ (void)memset(&st, 0, sizeof(&st));
} else if (wc == 0) {
break;
}
Home |
Main Index |
Thread Index |
Old Index