Skip to content

Commit

Permalink
Fix string initialization with null pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
dail8859 committed Sep 12, 2016
1 parent acd52f4 commit b3ed142
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs_gen/config.ld
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ custom_see_handler('^(SCI_[%w_]+)$', function(name)
return name, url
end)

project = 'LuaScript <sub>v0.5.0</sub>'
project = 'LuaScript <sub>v0.5.1</sub>'
title = 'LuaScript Reference'
description = 'Notepad++ plugin for [Lua](http://www.lua.org/) scripting capabilities.'
full_description = [[LuaScript allows you to customize Notepad++.
Expand Down
4 changes: 2 additions & 2 deletions src/SciTE/LuaExtension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2174,10 +2174,10 @@ bool LuaExtension::OnShutdown() {
}

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

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

bool LuaExtension::NeedsOnClose() {
Expand Down
8 changes: 4 additions & 4 deletions src/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

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

0 comments on commit b3ed142

Please sign in to comment.