[Merge] lp:~jamesodhunt/upstart/upstart-file-bridge-tidyup into lp:upstart

Steve Langasek steve.langasek at canonical.com
Tue Mar 19 20:23:32 UTC 2013


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.



More information about the upstart-devel mailing list