diff --git a/include/bal/platform.h b/include/bal/platform.h index 15da976..080fe42 100644 --- a/include/bal/platform.h +++ b/include/bal/platform.h @@ -277,7 +277,8 @@ typedef unsigned bal_threadret; # include # include -# define BAL_MAXERROR 256 +# define BAL_MAXERROR 256 +# define BAL_MAXERRORFMT 384 # define BAL_UNKNOWN "" # define BAL_AS_IPV6 "IPv6" diff --git a/include/bal/types.h b/include/bal/types.h index c1be907..fa1b7e8 100644 --- a/include/bal/types.h +++ b/include/bal/types.h @@ -76,7 +76,7 @@ typedef struct { /** The public error type. */ typedef struct { int code; - char message[BAL_MAXERROR]; + char message[BAL_MAXERRORFMT]; } bal_error; /** The internal error type. */ diff --git a/src/balerrors.c b/src/balerrors.c index ae3c622..8b7afaa 100644 --- a/src/balerrors.c +++ b/src/balerrors.c @@ -90,11 +90,11 @@ int _bal_get_error(bal_error* err, bool extended) } if (extended) { - _bal_snprintf_trunc(err->message, BAL_MAXERROR, BAL_ERRFMTEXT, + _bal_snprintf_trunc(err->message, BAL_MAXERRORFMT, BAL_ERRFMTEXT, _bal_tei.loc.func, _bal_tei.loc.file, _bal_tei.loc.line, _bal_okptrnf(heap_msg) ? heap_msg : bal_errors[n].msg); } else { - _bal_snprintf_trunc(err->message, BAL_MAXERROR, BAL_ERRFMT, + _bal_snprintf_trunc(err->message, BAL_MAXERRORFMT, BAL_ERRFMT, _bal_okptrnf(heap_msg) ? heap_msg : bal_errors[n].msg); }