Ticket #1700: gtkspell.diff

File gtkspell.diff, 1.2 kB (added by Gustavo Carneiro <gjc@…>, 3 years ago)
  • gtkspellmodule.c

     
    4646static PyObject * 
    4747_wrap_gtkspell_set_language (gtkspell_SpellObject *self, PyObject *args, PyObject *kwds) 
    4848{ 
    49         gchar *lang; 
     49        gchar *lang = NULL; 
    5050        gboolean result; 
    51          
    5251        char *argnames[] = {"language", NULL}; 
    53         PyArg_ParseTupleAndKeywords (args, kwds, "s", argnames, &lang); 
    5452 
     53        if (!PyArg_ParseTupleAndKeywords (args, kwds, "z", argnames, &lang)) 
     54            return NULL; 
     55 
    5556        result = gtkspell_set_language (self->spell, lang, NULL);        
    5657 
    5758        if (!result) { 
     
    8081        PyObject *pytextview; 
    8182        GtkTextView *textview; 
    8283        gtkspell_SpellObject *self;  
    83        
    8484        char *argnames[] = {"textview", NULL}; 
    85         PyArg_ParseTupleAndKeywords (args, kwds, "O", argnames, &pytextview); 
    8685 
     86        if (!PyArg_ParseTupleAndKeywords (args, kwds, "O", argnames, &pytextview)) 
     87            return NULL; 
     88 
    8789        textview = GTK_TEXT_VIEW(((PyGObject *)pytextview)->obj); 
    8890 
    8991        self = (gtkspell_SpellObject *)PyType_GenericAlloc((PyTypeObject *)&gtkspell_SpellType, 1); 
     
    202204        Py_FatalError ("can't initialise module gtkspell"); 
    203205    } 
    204206} 
     207