summaryrefslogtreecommitdiff
path: root/src/rc/rc-applets.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-01-21 15:30:40 +0000
committerRoy Marples <roy@marples.name>2008-01-21 15:30:40 +0000
commit07728abbc1eb1aa91d21318f3a3d64b15c2800fe (patch)
tree350dfce5968e05b1db4a1b7d94cb72dfdf830df4 /src/rc/rc-applets.c
parent847ccac13c8afc04d1105cc483c8ec7e9baa53a6 (diff)
downloadopenrc-07728abbc1eb1aa91d21318f3a3d64b15c2800fe.tar.gz
openrc-07728abbc1eb1aa91d21318f3a3d64b15c2800fe.tar.bz2
openrc-07728abbc1eb1aa91d21318f3a3d64b15c2800fe.tar.xz
Checking first char for null is more efficient than strlen.
Diffstat (limited to 'src/rc/rc-applets.c')
-rw-r--r--src/rc/rc-applets.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/rc/rc-applets.c b/src/rc/rc-applets.c
index 80e55aa..fc362a2 100644
--- a/src/rc/rc-applets.c
+++ b/src/rc/rc-applets.c
@@ -205,7 +205,7 @@ static int do_service (int argc, char **argv)
else
service = getenv ("SVCNAME");
- if (! service || strlen (service) == 0)
+ if (! service || *service == '\0')
eerrorx ("%s: no service specified", applet);
if (strcmp (applet, "service_started") == 0)
@@ -252,7 +252,7 @@ static int do_mark_service (int argc, char **argv)
else
service = getenv ("SVCNAME");
- if (! service || strlen (service) == 0)
+ if (! service || *service == '\0')
eerrorx ("%s: no service specified", applet);
if (strcmp (applet, "mark_service_started") == 0)
@@ -310,7 +310,7 @@ static int do_value (int argc, char **argv)
if (! service)
eerrorx ("%s: no service specified", applet);
- if (argc < 2 || ! argv[1] || strlen (argv[1]) == 0)
+ if (argc < 2 || ! argv[1] || *argv[1] == '\0')
eerrorx ("%s: no option specified", applet);
if (strcmp (applet, "service_get_value") == 0 ||