~ubuntu-branches/ubuntu/vivid/lvm2/vivid

« back to all changes in this revision

Viewing changes to lib/misc/sharedlib.c

  • Committer: Package Import Robot
  • Author(s): Bastian Blank
  • Date: 2012-05-01 20:27:50 UTC
  • mto: (3.1.23 sid)
  • mto: This revision was merged to the branch mainline in revision 72.
  • Revision ID: package-import@ubuntu.com-20120501202750-gljjjtblowwq9mw8
Tags: upstream-2.02.95
ImportĀ upstreamĀ versionĀ 2.02.95

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
        if (libname[0] == '/' ||
35
35
            !(lib_dir = find_config_tree_str(cmd, "global/library_dir", 0)) ||
36
36
            (dm_snprintf(path, path_len, "%s/%s", lib_dir,
37
 
                          libname) == -1) || stat(path, &info) == -1)
38
 
                strncpy(path, libname, path_len);
 
37
                         libname) == -1) || stat(path, &info) == -1) {
 
38
                strncpy(path, libname, path_len - 1);
 
39
                path[path_len - 1] = '\0';
 
40
        }
39
41
}
40
42
 
41
43
void *load_shared_library(struct cmd_context *cmd, const char *libname,