title: how to get a correctly sized window in ncurses
body: <p>I am trying out ncurses programming in C on Linux (Mint) and am having a strange problem.  I keep getting windows with the wrong number of columns for the first and final lines.  For example, with this code found on StackOverflow</p>
  
  <pre><code>#include &lt;ncurses.h&gt;
  int main(){
    initscr();
  
    WINDOW * win = newwin(10,50,10,10);
    box(win,0,0);
    wrefresh(win);
  
    wgetch(win);
    endwin();
    return 0;
  }
  </code></pre>
  
  <p>I get this output:</p>
  
  <pre><code>          ┌─┐
            │                                                │
            │                                                │
            │                                                │
            │                                                │
            │                                                │
            │                                                │
            │                                                │
            │                                                │
            └─┘
  </code></pre>
  
  <p>As if the first and final lines are only three columns wide.  If I add text to the window, using waddch, I can only add three characters to the top line as well.</p>
  
  <p>Any help would be appreciated, I can't find examples of other people running into this issue on the web, but it's not the easiest thing to come up with a good search string for.</p>