Skip to content
  • Hans Breuer's avatar
    [scan-build] Dereference of null pointer (maybe) · 840f8754
    Hans Breuer authored
    Protect potential null pointer access with g_return_if_fail().
    Remaining warnings show the unfinished state of focus handling:
    
    textedit.c: In function ‘textedit_end_edit’:
    textedit.c:148:19: warning: unused variable ‘change’ [-Wunused-variable]
       TextEditChange *change;
                       ^
    textedit.c: In function ‘textedit_remove_focus’:
    textedit.c:303:10: warning: unused variable ‘old_focus’ [-Wunused-variable]
       Focus *old_focus = get_active_focus((DiagramData *) diagram);
              ^
    textedit.c: At top level:
    textedit.c:370:1: warning: ‘text_edit_create_change’ defined but not used [-Wunused-function]
     text_edit_create_change(Text *text)
     ^
    textedit.c:394:1: warning: ‘text_edit_update’ defined but not used [-Wunused-function]
     text_edit_update(TextEditChange *change)
     ^
    textedit.c:303:10: warning: Value stored to 'old_focus' during its initialization is never read
      Focus *old_focus = get_active_focus((DiagramData *) diagram);
             ^~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1 warning generated.
    840f8754