OSSP CVS Repository

ossp - Difference in ossp-pkg/fsl/fsl.c versions 1.64 and 1.65
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/fsl/fsl.c 1.64 -> 1.65

--- fsl.c        2003/10/13 13:35:51     1.64
+++ fsl.c        2003/10/13 14:01:38     1.65
@@ -374,16 +374,19 @@
 /* alphabetically compare two filenames, use with qsort(3) */
 static int fnamecmp(const void *str1, const void *str2)
 {
-    if ((*(const char **)str1 != NULL) && (*(const char **)str2 != NULL))
-        return strcmp(*(const char **)str1, *(const char **)str2);
+    const char *s1 = *(const char **)str1;
+    const char *s2 = *(const char **)str2;
+
+    if ((s1 != NULL) && (s2 != NULL))
+        return strcmp(s1, s2);
 
     /* this must never happen but be prepared for the impossible */
 
-    if ((*(const char **)str1 != NULL) && (*(const char **)str2 == NULL))
-        return strcmp(*(const char **)str1, "");
+    if ((s1 != NULL) && (s2 == NULL))
+        return strcmp(s1, "");
 
-    if ((*(const char **)str1 == NULL) && (*(const char **)str2 != NULL))
-        return strcmp("", *(const char **)str1);
+    if ((s1 == NULL) && (s2 != NULL))
+        return strcmp("", s2);
 
     return strcmp("", "");
 }

CVSTrac 2.0.1