summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRikard Falkeborn <rikard.falkeborn@gmail.com>2019-04-05 00:02:51 +0200
committerAllan McRae <allan@archlinux.org>2019-05-08 10:12:14 +1000
commitf2a7fb2b96dd76f48b7750d1edeb6a85b7006856 (patch)
treea6580f932f6d93e5ee042c6376af018ccb06b10f /src
parenta8b3d1a62afaeee4f1586f6c463f6bf51f7a2d70 (diff)
downloadpacman-f2a7fb2b96dd76f48b7750d1edeb6a85b7006856.tar.xz
Fix clang 8 string-plus-int warnings
Clang 8 warns that adding a string to an integer does not append to string. Indeed it doesn't, but that was not the intentetion. Use array indexing as suggested by the compiler to silence the warning. There should be no functional change. Example of warning message: alpm.c:71:54: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int] sprintf(hookdir, "%s%s", myhandle->root, SYSHOOKDIR + 1); ~~~~~~~~~~~^~~ alpm.c:71:54: note: use array indexing to silence this warning sprintf(hookdir, "%s%s", myhandle->root, SYSHOOKDIR + 1); ^ & [ ] 1 warning generated.
Diffstat (limited to 'src')
-rw-r--r--src/pacman/conf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pacman/conf.c b/src/pacman/conf.c
index 3b79fbc7..2d8518c4 100644
--- a/src/pacman/conf.c
+++ b/src/pacman/conf.c
@@ -975,11 +975,11 @@ int setdefaults(config_t *c)
if(c->rootdir) {
char path[PATH_MAX];
if(!c->dbpath) {
- snprintf(path, PATH_MAX, "%s/%s", c->rootdir, DBPATH + 1);
+ snprintf(path, PATH_MAX, "%s/%s", c->rootdir, &DBPATH[1]);
SETDEFAULT(c->dbpath, strdup(path));
}
if(!c->logfile) {
- snprintf(path, PATH_MAX, "%s/%s", c->rootdir, LOGFILE + 1);
+ snprintf(path, PATH_MAX, "%s/%s", c->rootdir, &LOGFILE[1]);
SETDEFAULT(c->logfile, strdup(path));
}
} else {