[launchd-changes] [23645] trunk/launchd/src/liblaunch.c

source_changes at macosforge.org source_changes at macosforge.org
Mon Jul 28 11:12:23 PDT 2008


Revision: 23645
          http://trac.macosforge.org/projects/launchd/changeset/23645
Author:   zarzycki at apple.com
Date:     2008-07-28 11:12:23 -0700 (Mon, 28 Jul 2008)
Log Message:
-----------
Style

Modified Paths:
--------------
    trunk/launchd/src/liblaunch.c

Modified: trunk/launchd/src/liblaunch.c
===================================================================
--- trunk/launchd/src/liblaunch.c	2008-07-22 15:53:59 UTC (rev 23644)
+++ trunk/launchd/src/liblaunch.c	2008-07-28 18:12:23 UTC (rev 23645)
@@ -356,11 +356,13 @@
 {
 	size_t i;
 
-	if (LAUNCH_DATA_DICTIONARY != dict->type)
+	if (LAUNCH_DATA_DICTIONARY != dict->type) {
 		return;
+	}
 
-	for (i = 0; i < dict->_array_cnt; i += 2)
+	for (i = 0; i < dict->_array_cnt; i += 2) {
 		cb(dict->_array[i + 1], dict->_array[i]->string, context);
+	}
 }
 
 bool
@@ -372,8 +374,10 @@
 		where->_array_cnt = ind + 1;
 	}
 
-	if (where->_array[ind])
+	if (where->_array[ind]) {
 		launch_data_free(where->_array[ind]);
+	}
+
 	where->_array[ind] = what;
 	return true;
 }
@@ -381,11 +385,11 @@
 launch_data_t
 launch_data_array_get_index(launch_data_t where, size_t ind)
 {
-	if (LAUNCH_DATA_ARRAY != where->type)
+	if (LAUNCH_DATA_ARRAY != where->type || ind >= where->_array_cnt) {
 		return NULL;
-	if (ind < where->_array_cnt)
+	} else {
 		return where->_array[ind];
-	return NULL;
+	}
 }
 
 launch_data_t
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20080728/5ed2d185/attachment.html 


More information about the launchd-changes mailing list