Skip to content

Commit 0589943

Browse files
committed
Use integer 0 instead of character \0 in memset().
1 parent 55f90c8 commit 0589943

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

scintilla/lexers/LexHTML.cxx

+1-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ bool isHTMLCustomElement(const char *tag, size_t length, bool dashColon) noexcep
187187

188188
int classifyTagHTML(Sci_PositionU end, LexerWordList keywordLists, LexAccessor &styler, bool &tagDontFold, bool isXml, bool allowScripts) {
189189
char s[63 + 1];
190-
memset(s, '\0', 4);
190+
memset(s, 0, 4);
191191
const Sci_PositionU start = styler.GetStartSegment();
192192
styler.GetRange(start, end, s, sizeof(s));
193193
char *tag = s;

scintilla/lexers/LexPHP.cxx

+1-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ void PHPLexer::ClassifyHtmlTag(LexerWordList keywordLists) {
225225
sc.SetState((tagType == HtmlTagType::Question) ? SCE_H_QUESTION : SCE_H_TAG);
226226
} else if (tagType == HtmlTagType::None) {
227227
char s[16];
228-
memset(s, '\0', 4);
228+
memset(s, 0, 4);
229229
sc.GetCurrentLowered(s, sizeof(s));
230230
const char *p = s + 1;
231231
if (StrEqual(p, "script")) {

scintilla/lexers/LexVB.cxx

+1-1
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ void FoldVBDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, Le
503503
int ifThenMask = 0; // If ... Then ... End If
504504
int wordLen = 0;
505505
char s[MaxKeywordSize];
506-
memset(s, 4, 4);
506+
memset(s, 0, 4);
507507

508508
while (startPos < endPos) {
509509
const int style = initStyle;

scintilla/lexlib/LexAccessor.cxx

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ bool LexAccessor::MatchLowerCase(Sci_Position pos, const char *s) noexcept {
3939
void LexAccessor::GetRange(Sci_PositionU startPos_, Sci_PositionU endPos_, char *s, Sci_PositionU len) const noexcept {
4040
assert(s != nullptr);
4141
assert(startPos_ <= endPos_ && len != 0);
42-
//memset(s, '\0', len);
42+
//memset(s, 0, len);
4343
endPos_ = sci::min(endPos_, startPos_ + len - 1);
4444
//endPos_ = sci::min(endPos_, static_cast<Sci_PositionU>(lenDoc));
4545
len = endPos_ - startPos_;

src/EditAutoC.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class CharBuffer {
3333
explicit CharBuffer(size_t size) noexcept {
3434
if (size <= StackSize) {
3535
ptr = buffer;
36-
memset(buffer, '\0', StackSize);
36+
memset(buffer, 0, StackSize);
3737
} else {
3838
ptr = static_cast<char *>(NP2HeapAlloc(size));
3939
}

0 commit comments

Comments
 (0)