[Pkg-sysvinit-devel] Question for Miquel

Thomas Hood jdthood at yahoo.co.uk
Fri Jan 27 11:03:52 UTC 2006


I've been meaning to ask Miquel about the change shown below.  It worries me that
he left two \0 characters at the end of argv0 instead of just one.  I didn't see
any reason for doing so and a user asked for the change so I made it; but perhaps
Miquel knows something I don't.  Miquel, any comment?


diff -urNad --exclude=CVS --exclude=.svn ./src/init.c /tmp/dpep-work.aSvxrG/trunk/src/init.c
--- ./src/init.c        2006-01-04 17:44:08.000000000 +0100
+++ /tmp/dpep-work.aSvxrG/trunk/src/init.c      2006-01-04 17:44:20.000000000 +0100
@@ -615,9 +615,9 @@
        len = vsnprintf(buf, sizeof(buf), fmt, ap);
        va_end(ap);

-       if (maxproclen > 2) {
+       if (maxproclen > 1) {
                memset(argv0, 0, maxproclen);
-               strncpy(argv0, buf, maxproclen - 2);
+               strncpy(argv0, buf, maxproclen - 1);
        }



More information about the Pkg-sysvinit-devel mailing list