bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

mvwaddch error on windows with 1 column


From: codeunit
Subject: mvwaddch error on windows with 1 column
Date: Mon, 5 Mar 2012 22:50:13 +0200

Hello the following simple code produces ERR in mvwaddch

#include <ncurses.h>

char errorstring[100];
void die()
{
  endwin();
  printf ("%s\n", errorstring);
  exit(0);
}

int main()
{
  if (initscr() == NULL){
    printf ("error in initscr at %s:%d\n",  __FILE__, __LINE__);
  }
  WINDOW *parent;
  if ((parent = newwin(5,1,0,0)) == NULL){
    sprintf (errorstring, "newwin at %s:%d\n",  __FILE__, __LINE__);
    die();
  }
  int i;
  for (i=0; i<5; ++i)
  {
    if (       mvwaddch(parent, i, 0, 'n')  == ERR){
      sprintf (errorstring, "mvwaddch at %s:%d\n",  __FILE__, __LINE__);
      die();
    }
  }
  die();  
}

The problem comes up when i==4, i.e. mvwaddch prints the last character.
When I change newwin to (5,2,0,0) there is no ERR.
Apparently it is an issue of printing the last character of a window.

Cheers.
Linux 2.6.35-32-generic-pae #65-Ubuntu SMP Tue Jan 24 14:06:16 UTC 2012 i686 
GNU/Linux
ncurses5-config --version
5.7.20100626




reply via email to

[Prev in Thread] Current Thread [Next in Thread]