Skip to content

Commit f0c64c5

Browse files
fix warning
1 parent 499bc4b commit f0c64c5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cmd_in_second.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ static bool is_bulk_cmd()
6565

6666
static void get_whole_cmd(char* whole_cmd)
6767
{
68-
if (this.collection_name) {
68+
if (strlen(this.collection_name)) {
6969
sprintf(whole_cmd, "%s %s", this.collection_name, this.cmd);
7070
return;
7171
}
@@ -122,7 +122,9 @@ static void* buffer_flush_thread()
122122

123123
}
124124

125-
write(fd, log_str, strlen(log_str));
125+
if(write(fd, log_str, strlen(log_str)) <= 0) {
126+
mc_logger->log(EXTENSION_LOG_WARNING, NULL, "Can't allocate memory");
127+
}
126128

127129
close(fd);
128130

0 commit comments

Comments
 (0)