X-Git-Url: https://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=form%2Ffrm_driver.c;h=0c0912576dbb9d089c3142cf602bbf0fd44ed933;hb=4e6cadb948fd73686614442733848fe271e5d7b2;hp=2499f4da9218fd5e7957fc3fc77c2f5a4eef8816;hpb=3853a8e97d7efa8cb6a3c93c696d2c52895d6a70;p=ncurses.git diff --git a/form/frm_driver.c b/form/frm_driver.c index 2499f4da..0c091257 100644 --- a/form/frm_driver.c +++ b/form/frm_driver.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,2008 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 * @@ -32,7 +32,7 @@ #include "form.priv.h" -MODULE_ID("$Id: frm_driver.c,v 1.82 2007/06/02 22:59:24 tom Exp $") +MODULE_ID("$Id: frm_driver.c,v 1.86 2008/01/19 20:11:03 tom Exp $") /*---------------------------------------------------------------------------- This is the core module of the form library. It contains the majority @@ -676,7 +676,7 @@ Field_Grown(FIELD *field, int amount) new_bp[new_buflen] = myZEROS; } -#if USE_WIDEC_SUPPORT +#if USE_WIDEC_SUPPORT && NCURSES_EXT_FUNCS if (wresize(field->working, 1, Buffer_Length(field) + 1) == ERR) result = FALSE; #endif @@ -4379,7 +4379,7 @@ set_field_buffer(FIELD *field, int buffer, const char *value) wclear(field->working); mvwaddstr(field->working, 0, 0, value); - if ((widevalue = (FIELD_CELL *)calloc(len + 1, sizeof(FIELD_CELL))) == 0) + if ((widevalue = typeCalloc(FIELD_CELL, len + 1)) == 0) { RETURN(E_SYSTEM_ERROR); } @@ -4459,10 +4459,7 @@ field_buffer(const FIELD *field, int buffer) init_mb(state); next = _nc_wcrtomb(0, data[n].chars[0], &state); if (!isEILSEQ(next)) - { - if (next != 0) - need += next; - } + need += next; } } @@ -4476,7 +4473,7 @@ field_buffer(const FIELD *field, int buffer) { wclear(field->working); mvwadd_wchnstr(field->working, 0, 0, data, size); - mvwinnstr(field->working, 0, 0, result, (int)need + 1); + mvwinnstr(field->working, 0, 0, result, (int)need); } #else result = Address_Of_Nth_Buffer(field, buffer);