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

Re: gtk frontend for cdebconf, ready for commit



On Thu, Sep 05, 2002 at 02:50:26PM +0200, Martin Sj?gren wrote:
> tor 2002-09-05 klockan 02.31 skrev Michael Cardenas:
> > +void passwd_callback( GtkWidget *widget,
> > +                     GtkWidget *entry )
> > +{
> > +  const char *entrytext;
> > +  entrytext = gtk_entry_get_text (GTK_ENTRY (entry));
> > +  
> > +  gPassword = malloc(strlen(entrytext));
> > +  strcpy(gPassword, entrytext);
> 
> Why not just strdup?

...and the original allocates one byte too few; it needs an
extra byte for the NUL-terminator.

Matt



Reply to: