[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a
Maximiliano Curia
maxy at moszumanska.debian.org
Thu Jul 13 17:45:10 UTC 2017
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=e5609bb
The following commit has been merged in the master branch:
commit e5609bb8b5baf3e9cb2158311c2c341dd8d9ccb2
Author: Robin Mills <robin at clanmills.com>
Date: Sun Apr 26 07:10:13 2015 +0000
#1066 Thank You, Thomas for the patch.
1066 = The Battle of Hastings
---
src/tiffimage.cpp | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/src/tiffimage.cpp b/src/tiffimage.cpp
index 6dc30d5..de41481 100644
--- a/src/tiffimage.cpp
+++ b/src/tiffimage.cpp
@@ -48,7 +48,6 @@ EXIV2_RCSID("@(#) $Id$")
#include <iostream>
#include <iomanip>
#include <cassert>
-#include <memory>
#include <cstdarg>
/* --------------------------------------------------------------------------
@@ -345,20 +344,26 @@ namespace Exiv2 {
// http://stackoverflow.com/questions/2342162/stdstring-formatting-like-sprintf
static std::string stringFormat(const std::string fmt_str, ...) {
int n = ((int)fmt_str.size()) * 2; /* Reserve two times as much as the length of the fmt_str */
- std::unique_ptr<char[]> formatted;
+ char* formatted;
std::string str;
va_list ap;
bool ok = true;
- while(ok) {
- formatted.reset(new char[n]); /* Wrap the plain char array into the unique_ptr */
+ do {
+ formatted = new char[n];
strcpy(&formatted[0], fmt_str.c_str());
va_start(ap, fmt_str);
int final = vsnprintf(&formatted[0], n, fmt_str.c_str(), ap);
va_end(ap);
ok = final < 0 || final >= n;
- if ( ok ) n += abs(final - n + 1);
- }
- return std::string(formatted.get());
+ if (ok) {
+ n += abs(final - n + 1);
+ }
+ else {
+ str = std::string(formatted);
+ }
+ delete[] formatted;
+ } while (ok);
+ return str;
}
std::string stringValue(byte* buff,size_t size)
--
exiv2 packaging
More information about the pkg-kde-commits
mailing list