Fix returning a service descriptions.

This commit is contained in:
Roy Marples 2008-03-23 22:58:25 +00:00
parent 06635dedbc
commit a1b9768243

View File

@ -447,12 +447,12 @@ char *rc_service_description(const char *service, const char *option)
if (! (svc = rc_service_resolve(service)))
return NULL;
if (! option)
if (!option)
option = "";
l = strlen(DESCSTR) + strlen(svc) + strlen(option) + 2;
cmd = xmalloc(sizeof(char) * l);
snprintf(cmd, l, DESCSTR, svc, option ? "_" : "", option);
snprintf(cmd, l, DESCSTR, svc, *option ? "_" : "", option);
free(svc);
if ((fp = popen(cmd, "r"))) {
rc_getline(&desc, &len, fp);