diff options
Diffstat (limited to 'src/librc-daemon.c')
-rw-r--r-- | src/librc-daemon.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/librc-daemon.c b/src/librc-daemon.c index 13362d8c..dcac300c 100644 --- a/src/librc-daemon.c +++ b/src/librc-daemon.c @@ -448,8 +448,9 @@ bool rc_service_started_daemon (const char *service, const char *exec, if (indx > 0) { - file = rc_xmalloc (sizeof (char *) * 10); - snprintf (file, sizeof (file), "%03d", indx); + int len = sizeof (char *) * 10; + file = rc_xmalloc (len); + snprintf (file, len, "%03d", indx); retval = _match_daemon (dirpath, file, mexec, NULL, NULL); free (file); } |