Skip to content

Commit b3ed142

Browse files
committed
Fix string initialization with null pointer
1 parent acd52f4 commit b3ed142

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

docs_gen/config.ld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ custom_see_handler('^(SCI_[%w_]+)$', function(name)
2020
return name, url
2121
end)
2222

23-
project = 'LuaScript <sub>v0.5.0</sub>'
23+
project = 'LuaScript <sub>v0.5.1</sub>'
2424
title = 'LuaScript Reference'
2525
description = 'Notepad++ plugin for [Lua](http://www.lua.org/) scripting capabilities.'
2626
full_description = [[LuaScript allows you to customize Notepad++.

src/SciTE/LuaExtension.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2174,10 +2174,10 @@ bool LuaExtension::OnShutdown() {
21742174
}
21752175

21762176
bool LuaExtension::OnModification(const SCNotification *sc) {
2177-
const std::string text(sc->text, sc->length); // sc->text is not null terminated
21782177
int modType = sc->modificationType;
21792178

2180-
return CallNamedFunction("OnModification", "iiisi", modType, sc->position, sc->length, text.c_str(), sc->linesAdded);
2179+
return CallNamedFunction("OnModification", "iiisi", modType, sc->position, sc->length,
2180+
sc->text != NULL ? std::string(sc->text, sc->length).c_str() : "", sc->linesAdded);
21812181
}
21822182

21832183
bool LuaExtension::NeedsOnClose() {

src/Version.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
// along with this program; if not, write to the Free Software
1717
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
1818

19-
#define VERSION_NUM 0,5,0,0
20-
#define VERSION_LINEAR 500
21-
#define VERSION_LINEAR_TEXT TEXT("500")
22-
#define VERSION_TEXT TEXT("0.5.0") // This must match the tag pushed on the server minus the "v"
19+
#define VERSION_NUM 0,5,1,0
20+
#define VERSION_LINEAR 510
21+
#define VERSION_LINEAR_TEXT TEXT("510")
22+
#define VERSION_TEXT TEXT("0.5.1") // This must match the tag pushed on the server minus the "v"
2323
#define VERSION_STAGE TEXT("") // "alpha", "beta", ""

0 commit comments

Comments
 (0)