freebsd-ports/graphics/exiv2/files/patch-xmpsdk_src_XMPMeta.cpp
Matthias Andree ce4a214fb7 graphics/exiv2: upgrade to 0.28
Add DOCS and DOXYGEN options to allow building/installing
extra documentation.

Cherry-pick a few fixes from the upstream Git repo,
and add one FreeBSD-specific fix to libprocinfo interface
that caused crashes in the test rig, and add
sscanf/printf vs type fixes.

Fix a few things in exiv2 and Adobe XMP SDK found while
test-compiling exiv2 consumers.

All local fixes to .cpp filed with upstream repo as pull req.

While here, reformat/rearrange to please portlint and
portfmt/portclippy.

Assisted and
Reviewed by:		diizzy@
PR:                     272311
Differential Revision:  https://reviews.freebsd.org/D40828
2023-07-10 00:08:05 +02:00

15 lines
921 B
C++

XMP code is not dealing with format types properly. Cast argument to match format string.
filed as https://github.com/Exiv2/exiv2/pull/2671
--- xmpsdk/src/XMPMeta.cpp.orig 2023-05-08 16:01:13 UTC
+++ xmpsdk/src/XMPMeta.cpp
@@ -87,7 +87,7 @@ static const char * kTenSpaces = " ";
#define OutProcHexInt(num) { snprintf ( buffer, sizeof(buffer), "%X", (num) ); /* AUDIT: Using sizeof for snprintf length is safe */ \
status = (*outProc) ( refCon, buffer, strlen(buffer) ); if ( status != 0 ) goto EXIT; }
#else
-#define OutProcHexInt(num) { snprintf ( buffer, sizeof(buffer), "%lX", (num) ); /* AUDIT: Using sizeof for snprintf length is safe */ \
+#define OutProcHexInt(num) { snprintf ( buffer, sizeof(buffer), "%lX", (long)(num) ); /* AUDIT: Using sizeof for snprintf length is safe */ \
status = (*outProc) ( refCon, buffer, strlen(buffer) ); if ( status != 0 ) goto EXIT; }
#endif