mirror of
https://github.com/schoebel/mars
synced 2025-01-07 23:14:43 +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) {
|
if (write) {
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
} else {
|
} 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 know = CURRENT_TIME;
|
||||||
struct timespec lnow;
|
struct timespec lnow;
|
||||||
|
|
||||||
get_lamport(&lnow);
|
get_lamport(&lnow);
|
||||||
|
|
||||||
res = scnprintf(tmp, len,
|
res = scnprintf(tmp, my_len,
|
||||||
"CURRENT_TIME=%ld.%09ld\n"
|
"CURRENT_TIME=%ld.%09ld\n"
|
||||||
"lamport_now=%ld.%09ld\n",
|
"lamport_now=%ld.%09ld\n",
|
||||||
know.tv_sec, know.tv_nsec,
|
know.tv_sec, know.tv_nsec,
|
||||||
|
Loading…
Reference in New Issue
Block a user