mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 20:23:06 +00:00
fix issue #372
This commit is contained in:
@@ -28,7 +28,7 @@ skynet_error(struct skynet_context * context, const char *msg, ...) {
|
|||||||
va_start(ap,msg);
|
va_start(ap,msg);
|
||||||
int len = vsnprintf(tmp, LOG_MESSAGE_SIZE, msg, ap);
|
int len = vsnprintf(tmp, LOG_MESSAGE_SIZE, msg, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
if (len < LOG_MESSAGE_SIZE) {
|
if (len >=0 && len < LOG_MESSAGE_SIZE) {
|
||||||
data = skynet_strdup(tmp);
|
data = skynet_strdup(tmp);
|
||||||
} else {
|
} else {
|
||||||
int max_size = LOG_MESSAGE_SIZE;
|
int max_size = LOG_MESSAGE_SIZE;
|
||||||
@@ -44,6 +44,11 @@ skynet_error(struct skynet_context * context, const char *msg, ...) {
|
|||||||
skynet_free(data);
|
skynet_free(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (len < 0) {
|
||||||
|
skynet_free(data);
|
||||||
|
perror("vsnprintf error :");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
struct skynet_message smsg;
|
struct skynet_message smsg;
|
||||||
|
|||||||
Reference in New Issue
Block a user