mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-23 11:33:09 +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);
|
||||
int len = vsnprintf(tmp, LOG_MESSAGE_SIZE, msg, ap);
|
||||
va_end(ap);
|
||||
if (len < LOG_MESSAGE_SIZE) {
|
||||
if (len >=0 && len < LOG_MESSAGE_SIZE) {
|
||||
data = skynet_strdup(tmp);
|
||||
} else {
|
||||
int max_size = LOG_MESSAGE_SIZE;
|
||||
@@ -44,6 +44,11 @@ skynet_error(struct skynet_context * context, const char *msg, ...) {
|
||||
skynet_free(data);
|
||||
}
|
||||
}
|
||||
if (len < 0) {
|
||||
skynet_free(data);
|
||||
perror("vsnprintf error :");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
struct skynet_message smsg;
|
||||
|
||||
Reference in New Issue
Block a user