This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=4991acdd8f699aad32aad82ec932ed9877d1ac2d

commit 4991acdd8f699aad32aad82ec932ed9877d1ac2d
Author: Guillem Jover <[email protected]>
AuthorDate: Tue Feb 14 01:53:06 2023 +0100

    u-a: Reduce variables scope
    
    Warned-by: cppcheck
    Changelog: internal
---
 utils/start-stop-daemon.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/utils/start-stop-daemon.c b/utils/start-stop-daemon.c
index ca67976da..69db4995e 100644
--- a/utils/start-stop-daemon.c
+++ b/utils/start-stop-daemon.c
@@ -1177,10 +1177,8 @@ parse_schedule_item(const char *string, struct 
schedule_item *item)
 static void
 parse_schedule(const char *schedule_str)
 {
-       char item_buf[20];
        const char *slash;
-       int count, repeatat;
-       size_t str_len;
+       int count;
 
        count = 0;
        for (slash = schedule_str; *slash; slash++)
@@ -1202,9 +1200,14 @@ parse_schedule(const char *schedule_str)
                schedule[2].value = SIGKILL;
                schedule[3] = schedule[1];
        } else {
+               int repeatat;
+
                count = 0;
                repeatat = -1;
                while (*schedule_str) {
+                       char item_buf[20];
+                       size_t str_len;
+
                        slash = strchrnul(schedule_str, '/');
                        str_len = (size_t)(slash - schedule_str);
                        if (str_len >= sizeof(item_buf))

-- 
Dpkg.Org's dpkg

Reply via email to