--- parser3/src/main/pa_exception.C 2021/11/09 14:45:07 1.58 +++ parser3/src/main/pa_exception.C 2026/10/18 21:05:35 1.65 @@ -1,8 +1,8 @@ /** @file Parser: exception class. - Copyright (c) 2001-2020 Art. Lebedev Studio (http://www.artlebedev.com) - Author: Alexandr Petrosian (http://paf.design.ru) + Copyright (c) 2001-2026 Art. Lebedev Studio (https://www.artlebedev.com) + Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_common.h" @@ -10,7 +10,7 @@ #include "pa_sapi.h" #include "pa_globals.h" -volatile const char * IDENT_PA_EXCEPTION_C="$Id: pa_exception.C,v 1.58 2021/11/09 14:45:07 moko Exp $" IDENT_PA_EXCEPTION_H; +volatile const char * IDENT_PA_EXCEPTION_C="$Id: pa_exception.C,v 1.65 2026/10/18 21:05:35 moko Exp $" IDENT_PA_EXCEPTION_H; // methods @@ -39,12 +39,13 @@ Exception::Exception(const char* atype, va_list args; va_start(args, comment_fmt); fcomment=va_arg(args, const char *); + fcomment=fcomment ? pa_strdup(fcomment) : 0; va_end(args); } else { char comment[MAX_STRING]; va_list args; va_start(args, comment_fmt); - fcomment=pa_strdup(comment, vsnprintf(comment, MAX_STRING, comment_fmt, args)); + fcomment=pa_strdup(comment, pa_vsnprintf(comment, MAX_STRING, comment_fmt, args)); va_end(args); } }