diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2019-12-30 13:00:29 -0500 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2019-12-30 13:00:29 -0500 |
commit | d0e254663e64e40b676644038a9d7c95a2f25116 (patch) | |
tree | 193b9d0f5b58436b2ecbcb4762327c8560831a2b /src/install.c | |
parent | 4595ada2f69b42670c85a63c7d2344af63f2afe7 (diff) | |
download | spmc-d0e254663e64e40b676644038a9d7c95a2f25116.tar.gz |
Fix inane compiler warnings
* fix rpath_set
* add rpath_autoset
* add internal command "rpath_set"
Diffstat (limited to 'src/install.c')
-rw-r--r-- | src/install.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/install.c b/src/install.c index 1fb4513..7d41b36 100644 --- a/src/install.c +++ b/src/install.c @@ -63,8 +63,16 @@ int install(const char *destroot, const char *_package) { char cwd[PATH_MAX]; char source[PATH_MAX]; char template[PATH_MAX]; - char suffix[PATH_MAX] = "spm_destroot_XXXXXX"; - sprintf(template, "%s%c%s", TMP_DIR, DIRSEP, suffix); + + // circumvent -Wformat-truncation + char *suffix = (char *) calloc(PATH_MAX, sizeof(char)); + if (!suffix) { + perror("suffix"); + fprintf(SYSERROR); + } + strcpy(suffix, "spm_destroot_XXXXXX"); + snprintf(template, PATH_MAX, "%s%c%s", TMP_DIR, DIRSEP, suffix); + free(suffix); // Create a new temporary directory and extract the requested package into it char *tmpdir = mkdtemp(template); |