summaryrefslogtreecommitdiff
path: root/source/modules/asura-utils/exceptions
diff options
context:
space:
mode:
Diffstat (limited to 'source/modules/asura-utils/exceptions')
-rw-r--r--source/modules/asura-utils/exceptions/exception.cpp9
-rw-r--r--source/modules/asura-utils/exceptions/exception.h14
2 files changed, 1 insertions, 22 deletions
diff --git a/source/modules/asura-utils/exceptions/exception.cpp b/source/modules/asura-utils/exceptions/exception.cpp
index dbb36ca..5240c49 100644
--- a/source/modules/asura-utils/exceptions/exception.cpp
+++ b/source/modules/asura-utils/exceptions/exception.cpp
@@ -20,17 +20,10 @@ namespace AsuraEngine
size_out = vsnprintf(buffer, size_buffer, fmt, args);
va_end(args);
- // see http://perfec.to/vsnprintf/pasprintf.c
- // if size_out ...
- // == -1 --> output was truncated
- // == size_buffer --> output was truncated
- // == size_buffer-1 --> ambiguous, /may/ have been truncated
- // > size_buffer --> output was truncated, and size_out
- // bytes would have been written
if (size_out == size_buffer || size_out == -1 || size_out == size_buffer - 1)
size_buffer *= 2;
else if (size_out > size_buffer)
- size_buffer = size_out + 2; // to avoid the ambiguous case
+ size_buffer = size_out + 2;
else
break;
diff --git a/source/modules/asura-utils/exceptions/exception.h b/source/modules/asura-utils/exceptions/exception.h
index 57c9ed6..9873a38 100644
--- a/source/modules/asura-utils/exceptions/exception.h
+++ b/source/modules/asura-utils/exceptions/exception.h
@@ -7,27 +7,13 @@
namespace AsuraEngine
{
- /**
- * A convenient vararg-enabled exception class.
- **/
class Exception : public std::exception
{
public:
- /**
- * Creates a new Exception according to printf-rules.
- *
- * See: http://www.cplusplus.com/reference/clibrary/cstdio/printf/
- *
- * @param fmt The format string (see printf).
- **/
Exception(const char *fmt, ...);
virtual ~Exception() throw();
- /**
- * Returns a string containing reason for the exception.
- * @return A description of the exception.
- **/
inline virtual const char *what() const throw()
{
return message.c_str();