Skip to content

Commit

Permalink
fix message数量过多导致int溢出 (#2014)
Browse files Browse the repository at this point in the history
Co-authored-by: 角弓 <jiaogong.lzh@alibaba-inc.com>
  • Loading branch information
BMingSY and 角弓 authored Dec 26, 2024
1 parent cada3f5 commit 88df42a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions skynet-src/skynet_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct skynet_context {
uint32_t handle;
int session_id;
ATOM_INT ref;
int message_count;
size_t message_count;
bool init;
bool endless;
bool profile;
Expand Down Expand Up @@ -574,7 +574,7 @@ cmd_stat(struct skynet_context * context, const char * param) {
strcpy(context->result, "0");
}
} else if (strcmp(param, "message") == 0) {
sprintf(context->result, "%d", context->message_count);
sprintf(context->result, "%zu", context->message_count);
} else {
context->result[0] = '\0';
}
Expand Down

0 comments on commit 88df42a

Please sign in to comment.