X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=test%2Fview.c;h=d6de0d0a3985938657c774edc29fd3f2317b850f;hp=fe3a2114ea3a3ff3de30ed781dd1090e71d4f721;hb=03cbf5c46f9256e202a208aaf9650fd8332fec1d;hpb=d998cb49bfb53bd99900fd4ed94519579bea99de diff --git a/test/view.c b/test/view.c index fe3a2114..d6de0d0a 100644 --- a/test/view.c +++ b/test/view.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -50,7 +50,7 @@ * scroll operation worked, and the refresh() code only had to do a * partial repaint. * - * $Id: view.c,v 1.70 2008/11/16 00:19:59 juergen Exp $ + * $Id: view.c,v 1.75 2009/07/19 00:34:07 tom Exp $ */ #include @@ -151,11 +151,19 @@ ch_len(NCURSES_CH_T * src) { int result = 0; #if USE_WIDEC_SUPPORT + int count; #endif #if USE_WIDEC_SUPPORT - while (getcchar(src++, NULL, NULL, NULL, NULL) > 0) - result++; + for (;;) { + TEST_CCHAR(src, count, { + ++result; + ++src; + } + , { + break; + }) + } #else while (*src++) result++; @@ -283,7 +291,7 @@ main(int argc, char *argv[]) if (optind + 1 != argc) usage(); - if ((vec_lines = typeMalloc(NCURSES_CH_T *, MAXLINES + 2)) == 0) + if ((vec_lines = typeCalloc(NCURSES_CH_T *, MAXLINES + 2)) == 0) usage(); fname = argv[optind];