Skip to content

Commit

Permalink
fix bug: set the last char to be 0 in mg_read()
Browse files Browse the repository at this point in the history
  • Loading branch information
carfly committed Jul 22, 2013
1 parent 8a087cd commit d17d148
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/server/ltp_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ static int Service(struct mg_connection *conn)
if (!strcmp(ri->uri, "/ltp")) {
int len;
while((len = mg_read(conn, buffer, sizeof(buffer) - 1)) > 0){
buffer[len] = 0;
str_post_data += buffer;
}
cout << str_post_data.size() << " " << str_post_data << endl;
Expand Down

0 comments on commit d17d148

Please sign in to comment.