bug-ncurses
[Top][All Lists]
Advanced

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

wresize and maxx/maxy short int overflow


From: Katarina Machalkova
Subject: wresize and maxx/maxy short int overflow
Date: Mon, 2 Nov 2009 15:29:28 +0100
User-agent: KMail/1.10.3 (Linux/2.6.27.29-0.1-pae; KDE/4.1.3; i686; ; )

Hello, list,

Following is the code snippet:

{
   WINDOW *w
    ...
    LOG << "One: " << w->_maxy << " " << w->_maxx << endl;
    int ret = ::wresize( w, lines, columns );
    LOG << "Two: " << w->_maxy << " " << w->_maxx << endl;
}

maxy/maxx are short ints (NCURSES_SIZE_T, to be more precise), while wresize() 
takes "normal" ints as params. Now I'm trying to make the window really big in 
Y dimension by setting 'lines' param to value greater than 32 768.

The above prints:
One: 3 22
Two: -22207 22

Is this bug in a sense that maxy (maxx respectively) should never become 
negative,  or is it responsibility of the application calling wresize to make 
sure its params are always in range of short ints and overflow of maxy/maxx 
never occurs?

Thanks for advice (it's likely PEBCAK what I'm seeing but I'd rather be sure)

hB.
-- 
  \\\\\              Katarina Machalkova    
  \\\\\\\__o          YaST developer
__\\\\\\\'/_          & hedgehog painter




reply via email to

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