aboutsummaryrefslogtreecommitdiff
path: root/lib/src/rdsvc.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/src/rdsvc.c')
-rw-r--r--lib/src/rdsvc.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/lib/src/rdsvc.c b/lib/src/rdsvc.c
index 4b87312..c8ba590 100644
--- a/lib/src/rdsvc.c
+++ b/lib/src/rdsvc.c
@@ -122,13 +122,16 @@ static int svc_before(service_t *svc, char *arg, rdline_t *rd)
return -1;
}
- svc->raw_before = try_strdup(arg, rd);
- if (svc->raw_before == NULL)
+ svc->before = try_strdup(arg, rd);
+ if (svc->before == NULL)
return -1;
- svc->before = try_split_argv(svc->raw_before, rd);
- if (svc->before == NULL)
+ svc->num_before = pack_argv(svc->before);
+ if (svc->num_before < 0) {
+ fprintf(stderr, "%s: %zu: malformed string constant\n",
+ rd->filename, rd->lineno);
return -1;
+ }
return 0;
}
@@ -141,13 +144,16 @@ static int svc_after(service_t *svc, char *arg, rdline_t *rd)
return -1;
}
- svc->raw_after = try_strdup(arg, rd);
- if (svc->raw_after == NULL)
+ svc->after = try_strdup(arg, rd);
+ if (svc->after == NULL)
return -1;
- svc->after = try_split_argv(svc->raw_after, rd);
- if (svc->after == NULL)
+ svc->num_after = pack_argv(svc->after);
+ if (svc->num_after < 0) {
+ fprintf(stderr, "%s: %zu: malformed string constant\n",
+ rd->filename, rd->lineno);
return -1;
+ }
return 0;
}