From aa00bb461e5c8ca4266070b8d7f94a0d0cbcdb1c Mon Sep 17 00:00:00 2001 From: jpkneller Date: Tue, 2 Jul 2024 11:24:15 -0400 Subject: [PATCH] Update errors2.h --- src/BEMEWS/_ext/mstl/errors2.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/BEMEWS/_ext/mstl/errors2.h b/src/BEMEWS/_ext/mstl/errors2.h index 0632b7b..5501fd3 100644 --- a/src/BEMEWS/_ext/mstl/errors2.h +++ b/src/BEMEWS/_ext/mstl/errors2.h @@ -96,7 +96,7 @@ class BASIC_ERROR : public std::exception BASIC_ERROR(const std::string &WHICH,const std::string &WHO,const int &WHERE) : std::exception(){ function=ThrownIn+WHICH; object=InObject+WHO; - char buffer[7]; sprintf(buffer,"%d",WHERE); + char buffer[7]; snprintf(buffer,"%d",WHERE); line=AtLine+std::string(buffer); } @@ -114,8 +114,8 @@ class BASIC_ERROR : public std::exception void ChangeWhere(const std::string &WHERE){ line=AtLine+WHERE;} void ChangeLine(const std::string &WHERE){ line=AtLine+WHERE;} - void ChangeWhere(const int &WHERE){ char buffer[7]; sprintf(buffer,"%d",WHERE); line=AtLine+std::string(buffer);} - void ChangeLine(const int &WHERE){ char buffer[7]; sprintf(buffer,"%d",WHERE); line=AtLine+std::string(buffer);} + void ChangeWhere(const int &WHERE){ char buffer[7]; snprintf(buffer,"%d",WHERE); line=AtLine+std::string(buffer);} + void ChangeLine(const int &WHERE){ char buffer[7]; snprintf(buffer,"%d",WHERE); line=AtLine+std::string(buffer);} void Change(const std::string &WHICH=Unknown,const std::string &WHO=Unknown,const std::string &WHERE=Unknown) { function=( WHICH==Unknown ? function : ThrownIn+WHICH ); @@ -125,7 +125,7 @@ class BASIC_ERROR : public std::exception void Change(const std::string &WHICH,const std::string &WHO,const int &WHERE) { function=ThrownIn+WHICH; object=InObject+WHO; - char buffer[7]; sprintf(buffer,"%d",WHERE); + char buffer[7]; snprintf(buffer,"%d",WHERE); line=AtLine+std::string(buffer); }