From 6f4cca9cff6be9e562b4aa59ac73e5b04b49ad0d Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 6 Oct 1999 05:23:28 +0000 Subject: [PATCH] - fix to work with new version of FdfTk --- ext/fdf/config.m4 | 2 +- ext/fdf/fdf.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ext/fdf/config.m4 b/ext/fdf/config.m4 index 8aa92f29c7..594d64a4fb 100644 --- a/ext/fdf/config.m4 +++ b/ext/fdf/config.m4 @@ -18,7 +18,7 @@ AC_ARG_WITH(fdftk, ],[AC_MSG_ERROR(fdftk module requires fdftk 2.0)]) ;; *) - test -f $withval/include/Fdftk.h && FDFLIB_INCLUDE="-I$withval/include" + test -f $withval/include/FdfTk.h && FDFLIB_INCLUDE="-I$withval/include" if test -n "$FDFLIB_INCLUDE" ; then AC_MSG_RESULT(yes) PHP_EXTENSION(fdf) diff --git a/ext/fdf/fdf.c b/ext/fdf/fdf.c index 6417ce1789..e96ae4858b 100644 --- a/ext/fdf/fdf.c +++ b/ext/fdf/fdf.c @@ -217,6 +217,13 @@ PHP_FUNCTION(fdf_get_value) { err = FDFGetValue(fdf, arg2->value.str.val, NULL, 0, &nr); if(err != FDFErcOK) printf("Aiii, error\n"); + /* In the inofficial version of FdfTK 4.0 (as FDFGetVersion says. The + library has a name with version 3.0, don't know what adobe has in + mind) the number of bytes of the value doesn't include the trailing + '\0'. This was not the case in 2.0 + */ + if(strcmp(FDFGetVersion(), "2.0")) + nr++; buffer = emalloc(nr); err = FDFGetValue(fdf, arg2->value.str.val, buffer, nr, &nr); if(err != FDFErcOK) -- 2.40.0