mirror of
https://github.com/schoebel/mars
synced 2025-01-06 22:35:47 +00:00
proc: fix too long string allocation
This commit is contained in:
parent
17ef391953
commit
43e4312c1a
@ -127,13 +127,14 @@ int lamport_sysctl_handler(
|
||||
if (write) {
|
||||
return -EINVAL;
|
||||
} else {
|
||||
char *tmp = brick_string_alloc(len);
|
||||
int my_len = 128;
|
||||
char *tmp = brick_string_alloc(my_len);
|
||||
struct timespec know = CURRENT_TIME;
|
||||
struct timespec lnow;
|
||||
|
||||
get_lamport(&lnow);
|
||||
|
||||
res = scnprintf(tmp, len,
|
||||
res = scnprintf(tmp, my_len,
|
||||
"CURRENT_TIME=%ld.%09ld\n"
|
||||
"lamport_now=%ld.%09ld\n",
|
||||
know.tv_sec, know.tv_nsec,
|
||||
|
Loading…
Reference in New Issue
Block a user