- Update 2635.patch

OBS-URL: https://build.opensuse.org/package/show/multimedia:apps/gerbera?expand=0&rev=36
This commit is contained in:
Paolo Stivanin 2022-05-25 09:36:27 +00:00 committed by Git OBS Bridge
parent 1c0807ae8a
commit 05ed5c5c1f
2 changed files with 26 additions and 10 deletions

View File

@ -1,4 +1,4 @@
From 9e763df4e7be2e73c9b84001d85d0be8d8bb741c Mon Sep 17 00:00:00 2001
From ae46ab4684bd31df4537475dc33234ae85c9b1e6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Karl=20Strau=C3=9Fberger?= <k_straussberger@netzland.net>
Date: Tue, 17 May 2022 18:13:55 +0200
Subject: [PATCH] This and that
@ -8,9 +8,9 @@ May even solve:
src/metadata/resolution.cc | 4 ++--
src/upnp_xml.cc | 4 ++--
src/util/process_executor.cc | 3 ++-
src/util/tools.cc | 14 ++++++++++++--
src/util/tools.cc | 18 +++++++++++++++---
test/content/test_resolution.cc | 6 +++---
5 files changed, 21 insertions(+), 10 deletions(-)
5 files changed, 24 insertions(+), 11 deletions(-)
diff --git a/src/metadata/resolution.cc b/src/metadata/resolution.cc
index 031cb5788..476c644e5 100644
@ -65,10 +65,25 @@ index 5f238058a..8557175fe 100644
default:
break;
diff --git a/src/util/tools.cc b/src/util/tools.cc
index 119b74f5b..c549744be 100644
index 119b74f5b..4470b6f17 100644
--- a/src/util/tools.cc
+++ b/src/util/tools.cc
@@ -118,7 +118,17 @@ unsigned long stoulString(const std::string& str, int def, int base)
@@ -110,7 +110,13 @@ int stoiString(const std::string& str, int def, int base)
if (str.empty() || (str[0] == '-' && !std::isdigit(*str.substr(1).c_str())) || (str[0] != '-' && !std::isdigit(*str.c_str())))
return def;
- return std::stoi(str, nullptr, base);
+ try {
+ std::size_t pos;
+ return std::stoi(str, &pos, base);
+ } catch (const std::exception& ex) {
+ log_error("{} (input {})", ex.what(), str);
+ }
+ return def;
}
unsigned long stoulString(const std::string& str, int def, int base)
@@ -118,7 +124,13 @@ unsigned long stoulString(const std::string& str, int def, int base)
if (str.empty() || (str[0] == '-' && !std::isdigit(*str.substr(1).c_str())) || (str[0] != '-' && !std::isdigit(*str.c_str())))
return def;
@ -76,10 +91,6 @@ index 119b74f5b..c549744be 100644
+ try {
+ std::size_t pos;
+ return std::stoul(str, &pos, base);
+ } catch (const std::invalid_argument& iaex) {
+ log_error("ia {} (input {})", iaex.what(), str);
+ } catch (const std::out_of_range& oorex) {
+ log_error("oor {} (input {})", oorex.what(), str);
+ } catch (const std::exception& ex) {
+ log_error("{} (input {})", ex.what(), str);
+ }
@ -87,7 +98,7 @@ index 119b74f5b..c549744be 100644
}
void reduceString(std::string& str, char ch)
@@ -252,7 +262,7 @@ std::string urlEscape(std::string_view str)
@@ -252,7 +264,7 @@ std::string urlEscape(std::string_view str)
if ((i + cplen) > str.length())
cplen = 1;

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Wed May 25 09:36:13 UTC 2022 - Paolo Stivanin <info@paolostivanin.com>
- Update 2635.patch
-------------------------------------------------------------------
Wed May 18 09:23:12 UTC 2022 - Paolo Stivanin <info@paolostivanin.com>