vcl/unx/generic/print/printerjob.cxx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
New commits: commit b3be89a02c8d90f4620cc16d1e386c6912904bd6 Author: Julien Nabet <serval2...@yahoo.fr> Date: Sat Mar 18 17:53:03 2017 +0100 cppcheck: alloca (vcl/printerjob) Remove it since useless Add an assert to pBuffer Remove an useless variable Change-Id: Icac2bc6582ca6f2bebe628e9454b9212206b269d Reviewed-on: https://gerrit.libreoffice.org/35408 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/vcl/unx/generic/print/printerjob.cxx b/vcl/unx/generic/print/printerjob.cxx index 1f9689ac9bb2..13dd71711c2e 100644 --- a/vcl/unx/generic/print/printerjob.cxx +++ b/vcl/unx/generic/print/printerjob.cxx @@ -38,7 +38,6 @@ #include <osl/thread.h> #include <osl/security.hxx> -#include <sal/alloca.h> #include <sal/macros.h> #include <algorithm> @@ -55,21 +54,18 @@ namespace psp bool AppendPS (FILE* pDst, osl::File* pSrc, unsigned char* pBuffer) { - sal_uInt32 nBlockSize = nBLOCKSIZE; + assert(pBuffer); if ((pDst == nullptr) || (pSrc == nullptr)) return false; if (pSrc->setPos(osl_Pos_Absolut, 0) != osl::FileBase::E_None) return false; - if (pBuffer == nullptr) - pBuffer = static_cast<unsigned char*>(alloca (nBlockSize)); - sal_uInt64 nIn = 0; sal_uInt64 nOut = 0; do { - pSrc->read (pBuffer, nBlockSize, nIn); + pSrc->read (pBuffer, nBLOCKSIZE, nIn); if (nIn > 0) nOut = fwrite (pBuffer, 1, sal::static_int_cast<sal_uInt32>(nIn), pDst); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits