@ -324,6 +324,7 @@ static int isfullutf8(char *, int);
static void * xmalloc ( size_t ) ;
static void * xmalloc ( size_t ) ;
static void * xrealloc ( void * , size_t ) ;
static void * xrealloc ( void * , size_t ) ;
static void * xcalloc ( size_t nmemb , size_t size ) ;
static void ( * handler [ LASTEvent ] ) ( XEvent * ) = {
static void ( * handler [ LASTEvent ] ) ( XEvent * ) = {
[ KeyPress ] = kpress ,
[ KeyPress ] = kpress ,
@ -373,6 +374,14 @@ xrealloc(void *p, size_t len) {
return p ;
return p ;
}
}
void *
xcalloc ( size_t nmemb , size_t size ) {
void * p = calloc ( nmemb , size ) ;
if ( ! p )
die ( " Out of memory \n " ) ;
return p ;
}
int
int
utf8decode ( char * s , long * u ) {
utf8decode ( char * s , long * u ) {
uchar c ;
uchar c ;
@ -1801,8 +1810,8 @@ tresize(int col, int row) {
/* allocate any new rows */
/* allocate any new rows */
for ( /* i == minrow */ ; i < row ; i + + ) {
for ( /* i == minrow */ ; i < row ; i + + ) {
term . dirty [ i ] = 1 ;
term . dirty [ i ] = 1 ;
term . line [ i ] = calloc( col , sizeof ( Glyph ) ) ;
term . line [ i ] = x calloc( col , sizeof ( Glyph ) ) ;
term . alt [ i ] = calloc( col , sizeof ( Glyph ) ) ;
term . alt [ i ] = x calloc( col , sizeof ( Glyph ) ) ;
}
}
if ( col > term . col ) {
if ( col > term . col ) {
bool * bp = term . tabs + term . col ;
bool * bp = term . tabs + term . col ;