Merge lp:~jamesodhunt/upstart/upstart-file-bridge-tidyup into lp:upstart
Proposed by
James Hunt
Status: | Merged |
---|---|
Merged at revision: | 1455 |
Proposed branch: | lp:~jamesodhunt/upstart/upstart-file-bridge-tidyup |
Merge into: | lp:upstart |
Diff against target: |
236 lines (+46/-41) 2 files modified
ChangeLog (+12/-0) extra/upstart-file-bridge.c (+34/-41) |
To merge this branch: | bzr merge lp:~jamesodhunt/upstart/upstart-file-bridge-tidyup |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Steve Langasek | Approve | ||
Review via email: mp+153797@code.launchpad.net |
Description of the change
* extra/upstart-
- main(): String safety for home_dir.
- job_add_file():
- Initialise events.
- Use nih_strdup() rather than arrays for paths.
- Removed unecessary error label.
- {create_
- watched_dir_new(): Use nih_strdup() rather than arrays for path.
- find_first_
To post a comment you must log in.
@@ -1683,7 +1675,8 @@
do {
parent = dirname (tmp);
/* save parent for next time through the loop */
- strcpy (tmp, current);
+ memset (tmp, '\0', sizeof (tmp));
+ strncpy (tmp, current, sizeof (tmp)-1);
/* 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.