comparison ui.c @ 535:379e361f1144

Fix various segfault issues.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 14 Aug 2012 02:17:03 +0300
parents 436e86afa70a
children 658c188101a6
comparison
equal deleted inserted replaced
534:b1bb64e2e776 535:379e361f1144
401 #else 401 #else
402 snprintf(tmpStr, sizeof(tmpStr), 402 snprintf(tmpStr, sizeof(tmpStr),
403 " %s | %s | #%06x | WIN: %d: %s / %d | ", 403 " %s | %s | #%06x | WIN: %d: %s / %d | ",
404 tmpStamp, 404 tmpStamp,
405 username != NULL ? username : "-", 405 username != NULL ? username : "-",
406 usercolor, 406 usercolor,
407 currWin->num + 1, 407 currWin != NULL ? currWin->num + 1 : 0,
408 currWin->id != NULL ? currWin->id : "MAIN", 408 (currWin != NULL && currWin->id != NULL) ? currWin->id : "MAIN",
409 currWin->pos); 409 currWin != NULL ? currWin->pos : 0);
410 #endif 410 #endif
411 411
412 wmove(stdscr, scrHeight - 4, 0); 412 wmove(stdscr, scrHeight - 4, 0);
413 wbkgdset(stdscr, COLOR_PAIR(10)); 413 wbkgdset(stdscr, COLOR_PAIR(10));
414 wclrtoeol(stdscr); 414 wclrtoeol(stdscr);
426 426
427 // Restore cursor position 427 // Restore cursor position
428 wmove(stdscr, sy, sx); 428 wmove(stdscr, sy, sx);
429 429
430 // Update editbuf if needed 430 // Update editbuf if needed
431 if (ebuf != NULL && (force || ebuf->dirty)) 431 if (cursesInit && ebuf != NULL && (force || ebuf->dirty))
432 { 432 {
433 int yoffs = ebuf->pos / scrWidth, 433 int yoffs = ebuf->pos / scrWidth,
434 xoffs = ebuf->pos % scrWidth; 434 xoffs = ebuf->pos % scrWidth;
435 435
436 wmove(stdscr, scrHeight - 3, 0); 436 wmove(stdscr, scrHeight - 3, 0);