Review: Approve

@@ -1683,7 +1675,8 @@
 
        do {
                /* save parent for next time through the loop */
-               strcpy (tmp, current);
+               memset (tmp, '\0', sizeof (tmp));
+               strncpy (tmp, current, sizeof (tmp)-1);
                parent = dirname (tmp);
 
                /* Ensure dirname returned something sane */

I've always preferred tmp[sizeof (tmp) - 1] = '\0' rather than memset, avoids 
wasting cycles zero-filling an area that you're just going to overwrite 
immediately afterwards.  But looks good, landing.
-- 
https://code.launchpad.net/~jamesodhunt/upstart/upstart-file-bridge-tidyup/+merge/153797
Your team Upstart Reviewers is subscribed to branch lp:upstart.

-- 
upstart-devel mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/upstart-devel

Reply via email to