diff options
author | Aki <please@ignore.pl> | 2024-02-17 22:17:32 +0100 |
---|---|---|
committer | Aki <please@ignore.pl> | 2024-02-17 22:17:32 +0100 |
commit | 764bd0b8bff46b944cf8cc123527938ed2ceabad (patch) | |
tree | efd390fba690f5d35e031880e33e95b54ea7b777 /DefinitionEx | |
parent | 24cccb0a775f3f5cd39988529e86019517a3570a (diff) | |
download | starshatter-764bd0b8bff46b944cf8cc123527938ed2ceabad.zip starshatter-764bd0b8bff46b944cf8cc123527938ed2ceabad.tar.gz starshatter-764bd0b8bff46b944cf8cc123527938ed2ceabad.tar.bz2 |
Use pre-C11/non-Windows sprintf and strcpy
Diffstat (limited to 'DefinitionEx')
-rw-r--r-- | DefinitionEx/Parser_ss.cpp | 3 | ||||
-rw-r--r-- | DefinitionEx/Token.cpp | 8 |
2 files changed, 5 insertions, 6 deletions
diff --git a/DefinitionEx/Parser_ss.cpp b/DefinitionEx/Parser_ss.cpp index 94f7856..246e4a5 100644 --- a/DefinitionEx/Parser_ss.cpp +++ b/DefinitionEx/Parser_ss.cpp @@ -28,8 +28,7 @@ static int dump_tokens = 0; Term* error(char* msg, const Token& token) { static char buf[1024]; - sprintf_s(buf, " near '%s' in line %d.", (const char*) token.symbol(), token.line()); - + snprintf(buf, 1024, " near '%s' in line %d", (const char*) token.symbol(), token.line()); return error(msg, buf); } diff --git a/DefinitionEx/Token.cpp b/DefinitionEx/Token.cpp index 2cc97b5..e61a1fb 100644 --- a/DefinitionEx/Token.cpp +++ b/DefinitionEx/Token.cpp @@ -40,7 +40,7 @@ Token::Token(const Token& rhs) { mLength = rhs.mLength; if (mLength < 8) { - strcpy_s(mSymbol, rhs.mSymbol); + strcpy(mSymbol, rhs.mSymbol); } else { mFullSymbol = new char[mLength + 1]; @@ -60,7 +60,7 @@ Token::Token(const char* s, int t, int k, int l, int c) { mLength = strlen(s); if (mLength < 8) { - strcpy_s(mSymbol, s); + strcpy(mSymbol, s); } else { mFullSymbol = new char[mLength + 1]; @@ -73,7 +73,7 @@ Token::Token(const Text& s, int t, int k, int l, int c) { mLength = s.length(); if (mLength < 8) { - strcpy_s(mSymbol, s.data()); + strcpy(mSymbol, s.data()); } else { mFullSymbol = new char[mLength + 1]; @@ -105,7 +105,7 @@ Token::operator = (const Token& rhs) mLength = rhs.mLength; if (mLength < 8) { - strcpy_s(mSymbol, rhs.mSymbol); + strcpy(mSymbol, rhs.mSymbol); } else { mFullSymbol = new char[mLength + 1]; |