[icinga-checkins] icinga.org: icinga-core/dev/core: bail early if there aren' t any illegal_object_chars defined

git at icinga.org git at icinga.org
Sun Mar 10 20:49:56 CET 2013


Module: icinga-core
Branch: dev/core
Commit: 8d50e29b883cb567b7bd385c7afc59ba7663352e
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=8d50e29b883cb567b7bd385c7afc59ba7663352e

Author: Michael Friedrich <michael.friedrich at netways.de>
Date:   Sun Mar 10 19:22:57 2013 +0100

bail early if there aren't any illegal_object_chars defined

which saves some strcmp nops.

refs #3389

---

 base/utils.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/base/utils.c b/base/utils.c
index 2000268..ef05ab1 100644
--- a/base/utils.c
+++ b/base/utils.c
@@ -3249,7 +3249,7 @@ int contains_illegal_object_chars(char *name) {
 	register int x = 0;
 	register int y = 0;
 
-	if (name == NULL)
+	if (name == NULL || illegal_object_chars == NULL)
 		return FALSE;
 
 	x = (int)strlen(name) - 1;





More information about the icinga-checkins mailing list