summaryrefslogtreecommitdiffstats
path: root/libraries/pack200/src/utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/pack200/src/utils.cpp')
-rw-r--r--libraries/pack200/src/utils.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/libraries/pack200/src/utils.cpp b/libraries/pack200/src/utils.cpp
index 0b7d91ca..fd6dad60 100644
--- a/libraries/pack200/src/utils.cpp
+++ b/libraries/pack200/src/utils.cpp
@@ -50,22 +50,22 @@
void *must_malloc(size_t size)
{
- size_t msize = size;
- void *ptr = (msize > PSIZE_MAX) ? nullptr : malloc(msize);
- if (ptr != nullptr)
- {
- memset(ptr, 0, size);
- }
- else
- {
- throw std::runtime_error(ERROR_ENOMEM);
- }
- return ptr;
+ size_t msize = size;
+ void *ptr = (msize > PSIZE_MAX) ? nullptr : malloc(msize);
+ if (ptr != nullptr)
+ {
+ memset(ptr, 0, size);
+ }
+ else
+ {
+ throw std::runtime_error(ERROR_ENOMEM);
+ }
+ return ptr;
}
void unpack_abort(const char *msg)
{
- if (msg == nullptr)
- msg = "corrupt pack file or internal error";
- throw std::runtime_error(msg);
+ if (msg == nullptr)
+ msg = "corrupt pack file or internal error";
+ throw std::runtime_error(msg);
}