Permalink
Browse files

Changed way char is converted to string for JS

  • Loading branch information...
1 parent 1825d63 commit ca583c61f327c84a4a12d855005a643e364ca56f @faceleg faceleg committed Apr 5, 2013
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/diff_list.cc
View
@@ -435,8 +435,12 @@ void GitDiffList::WalkWorkSendFile(uv_async_t *handle, int status /*UNUSED*/) {
content->Set(String::New("range"), range);
content->Set(String::New("content"), String::New(rawContent->content.c_str()));
+ // char lineOrigin[2];
+ // strncpy(lineOrigin, &rawContent->lineOrigin, 1);
char lineOrigin[2];
- strncpy(lineOrigin, &rawContent->lineOrigin, 1);
+ lineOrigin[0] = rawContent->lineOrigin;
+ lineOrigin[1] = '\0';
+ // std::string lineOrigin(rawContent->lineOrigin);
content->Set(String::New("lineOrigin"), String::New(lineOrigin));
content->Set(String::New("contentLength"), Integer::New(rawContent->contentLength));

0 comments on commit ca583c6

Please sign in to comment.