changeset 35400:074069bb765a

Don't increment a pointer which might be null.
author ib
date Wed, 28 Nov 2012 11:57:52 +0000
parents 4d7adee0a7ba
children 0c93b5400dc7
files gui/ui/gtk/skinbrowser.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gui/ui/gtk/skinbrowser.c	Wed Nov 28 11:40:52 2012 +0000
+++ b/gui/ui/gtk/skinbrowser.c	Wed Nov 28 11:57:52 2012 +0000
@@ -79,7 +79,9 @@
    if ( !strcmp( gg.gl_pathv[i],"." ) || !strcmp( gg.gl_pathv[i],".." ) ) continue;
    if ( ( stat( gg.gl_pathv[i],&fs ) == 0 ) && S_ISDIR( fs.st_mode ) )
     {
-     tmp=strrchr( gg.gl_pathv[i],'/' ); tmp++;
+     tmp=strrchr( gg.gl_pathv[i],'/' );
+     if (tmp) tmp++;
+     else tmp = gg.gl_pathv[i];
      if ( !strcmp( tmp,"default" ) ) continue;
      str[0]=tmp;
      if ( gtkFindCList( SkinList,str[0] ) == -1 ) gtk_clist_append( GTK_CLIST( SkinList ),str );