summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Terceiro <terceiro@debian.org>2014-06-07 16:50:05 +0200
committerWolfgang Hommel <wolfgang.hommel@lrz.de>2014-06-07 16:50:05 +0200
commit1faf137f7210a08d109e3b89a9312e73d217de25 (patch)
treef269748eb635e4f90959fb714c19affb843a3ef0
parent7d1a8307e164f94005b795992b2e1a843d34e608 (diff)
downloadfaketime-ng-1faf137f7210a08d109e3b89a9312e73d217de25.tar.gz
fix handling of existing LD_PRELOAD in environment
This patch fixes handling of the string length when composing an updated LD_PRELOAD that includes both the previous value and the entry for libeatmydata.
-rw-r--r--src/faketime.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/faketime.c b/src/faketime.c
index 44bdf76..191b232 100644
--- a/src/faketime.c
+++ b/src/faketime.c
@@ -313,7 +313,7 @@ int main (int argc, char **argv)
ftpl_path = PREFIX "/$LIB/faketime/libfaketime.so.1";
#endif
}
- len = (ld_preload)?strlen(ld_preload):0 + 2 + strlen(ftpl_path);
+ len = ((ld_preload)?strlen(ld_preload) + 1: 0) + 1 + strlen(ftpl_path);
ld_preload_new = malloc(len);
snprintf(ld_preload_new, len ,"%s%s%s", (ld_preload)?ld_preload:"",
(ld_preload)?":":"", ftpl_path);