title: Segmentation fault:core Dumped while using mvscanw function of ncurses in c on ubuntu
body: <p>I am trying to read a input string from keyboard and display it on new window in ncurses.
  The string received is passed to function display.
  This function has a linklist .
  The string is compared with an element of this linklist structure from the top to the end of the list.
  if match is found,it prints those particular list elements and If not, it comes out.</p>
  
  <p>Here's the code:</p>
  
  <pre><code>void main()
  {
   char *str=(char*)malloc(10*sizeof(char));
   mvprintw (1,0, "%s","ivrcode:");
   mvscanw(1,8,"%s",str);
   mvprintw (1,8, "%s",str); 
   initscr ();
   cbreak();
   curs_set (2);
   clear();
   display1(str);
   refresh();
  
  
  }
  
  
  void display1(char *r)
  { char * status;
  int   thisDTMF;
  struct linklist * curser=listhead;
  int count;
  mvprintw (2,0, "%s","vId");
  mvprintw (2,10, "%s","msisdn" );
  mvprintw (2,25, "%s","ivrCode" );
  mvprintw (2,35, "%s","state" );
  mvprintw (2,45, "%s","DTMF" );
  count = 4;
  while(curser!=NULL)
  { status=getState(curser-&gt;state);
    thisDTMF=getDTMF(curser-&gt;dtmf);
    if(curser-&gt;ivrCode==r)
    { mvprintw (count,0,"%d",curser-&gt;vId);
    mvprintw (count,10,"%s",curser-&gt;msisdn);
    mvprintw (count,25, "%s",curser-&gt;ivrCode );
    mvprintw (count,35, "%s",status );
    if(thisDTMF==35||thisDTMF==42)
        mvprintw (count,45, "%c",thisDTMF );
    else
    mvprintw (count,45, "%d",thisDTMF );
    count++;
    }
  
        curser=curser-&gt;next;
  }
  
   }
  </code></pre>
  
  <p>It is taking input string from keyboard and printing as well.<br>
  compiling successfully.<br>
  But when i hit enter it shows nothing.<br>
  Any suggestions?</p>