OSSP CVS Repository

ossp - Difference in ossp-pkg/rc/rc_util.c versions 1.7 and 1.8
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/rc/rc_util.c 1.7 -> 1.8

--- rc_util.c    2003/05/15 22:22:30     1.7
+++ rc_util.c    2003/05/20 17:14:17     1.8
@@ -109,8 +109,20 @@
 /* Section priority compare, to use with qsort(3) */
 int priCompare(const void *pkv1, const void *pkv2)
 {
-    int nOne = ((rc_section_t *)pkv1)->m_nPri;
-    int nTwo = ((rc_section_t *)pkv2)->m_nPri;
+    int nOne = 0;
+    int nTwo = 0;
+
+    if (pkv1) {
+        nOne = ((rc_section_t *)pkv1)->m_nPri;
+        if (pkv2)
+            nTwo = ((rc_section_t *)pkv2)->m_nPri;
+        else
+            return (-1);
+    }
+    else if (pkv2)
+        return (1);
+    else
+        return (0);
 
     if (nOne)
         if (nTwo)

CVSTrac 2.0.1