--- parser3/src/main/pa_exception.C 2021/11/10 10:14:18 1.60 +++ 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.60 2021/11/10 10:14:18 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 @@ -38,13 +38,14 @@ Exception::Exception(const char* atype, } else if (!strcmp(comment_fmt, "%s")) { // to avoid MAX_STRING limit va_list args; va_start(args, comment_fmt); - fcomment=va_arg(args, const char *) ? pa_strdup(va_arg(args, const char *)) : 0; + 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); } }