fix: string overflow

This commit is contained in:
Baoshuo Ren 2022-09-18 18:49:02 +08:00
parent 410631075e
commit 09d4fa0515
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A

View File

@ -42,7 +42,7 @@ string dirname(const string &path) {
}
}
string getcwdp(pid_t pid) {
char s[20];
char s[50];
char cwd[MaxPathLen + 1];
if (pid != 0) {
sprintf(s, "/proc/%lld/cwd", (long long int)pid);