]> granicus.if.org Git - imagemagick/commitdiff
MagickCore/xwindow.c: remove not needed check (#1292)
authorIlya Shipitsin <chipitsine@gmail.com>
Sat, 8 Sep 2018 13:56:49 +0000 (18:56 +0500)
committerImageMagick <urban-warrior@users.noreply.github.com>
Sat, 8 Sep 2018 13:56:49 +0000 (09:56 -0400)
found by cppcheck

there's already check in line 3367
https://github.com/ImageMagick/ImageMagick/blob/master/MagickCore/xwindow.c#L3367

MagickCore/xwindow.c

index a394851fadd5ad5a5a5cdff257692bad27d0a28b..7149c405515bd116d02074c713365b648b94102c 100644 (file)
@@ -3374,17 +3374,14 @@ MagickExport XrmDatabase XGetResourceDatabase(Display *display,
   /*
     Combine application database.
   */
-  if (client_name != (char *) NULL)
-    {
-      /*
-        Get basename of client.
-      */
-      p=client_name+(strlen(client_name)-1);
-      while ((p > client_name) && (*p != '/'))
-        p--;
-      if (*p == '/')
-        client_name=p+1;
-    }
+  /*
+    Get basename of client.
+  */
+  p=client_name+(strlen(client_name)-1);
+  while ((p > client_name) && (*p != '/'))
+    p--;
+  if (*p == '/')
+    client_name=p+1;
   c=(int) (*client_name);
   if ((c >= XK_a) && (c <= XK_z))
     c-=(XK_a-XK_A);