aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDFSystemError.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2022-04-02 23:14:10 +0200
committerJay Berkenbilt <ejb@ql.org>2022-04-04 14:10:40 +0200
commit12f1eb15ca3fed6310402847559a7c99d3c77847 (patch)
tree8935675b623c6f3b4914b8b44f7fa5f2816a9241 /libqpdf/QPDFSystemError.cc
parentf20fa61eb4c323eb1642c69c236b3d9a1f8b2cdb (diff)
downloadqpdf-12f1eb15ca3fed6310402847559a7c99d3c77847.tar.zst
Programmatically apply new formatting to code
Run this: for i in **/*.cc **/*.c **/*.h **/*.hh; do clang-format < $i >| $i.new && mv $i.new $i done
Diffstat (limited to 'libqpdf/QPDFSystemError.cc')
-rw-r--r--libqpdf/QPDFSystemError.cc14
1 files changed, 5 insertions, 9 deletions
diff --git a/libqpdf/QPDFSystemError.cc b/libqpdf/QPDFSystemError.cc
index 775a65cf..d300a00b 100644
--- a/libqpdf/QPDFSystemError.cc
+++ b/libqpdf/QPDFSystemError.cc
@@ -3,8 +3,8 @@
#include <qpdf/QUtil.hh>
#include <string.h>
-QPDFSystemError::QPDFSystemError(std::string const& description,
- int system_errno) :
+QPDFSystemError::QPDFSystemError(
+ std::string const& description, int system_errno) :
std::runtime_error(createWhat(description, system_errno)),
description(description),
system_errno(system_errno)
@@ -16,8 +16,7 @@ QPDFSystemError::~QPDFSystemError() noexcept
}
std::string
-QPDFSystemError::createWhat(std::string const& description,
- int system_errno)
+QPDFSystemError::createWhat(std::string const& description, int system_errno)
{
std::string message;
#ifdef _MSC_VER
@@ -25,12 +24,9 @@ QPDFSystemError::createWhat(std::string const& description,
// message is longer. strerror_s is a templated function that
// knows the size of buf and truncates.
char buf[94];
- if (strerror_s(buf, system_errno) != 0)
- {
+ if (strerror_s(buf, system_errno) != 0) {
message = description + ": failed with an unknown error";
- }
- else
- {
+ } else {
message = description + ": " + buf;
}
#else