X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=tfc_misc.c;h=44e1117be6342ec710d8e6848824cd55b9d6f895;hb=92b6bb91a5be9fc1b4d300f99b239cb8e3a6398d;hp=a39f4591831ddf988f8cbcb74ab323658c74b76a;hpb=96e6e88fd94af95e15d143e4a86d5a9e858d340d;p=tfcrypt.git diff --git a/tfc_misc.c b/tfc_misc.c index a39f459..44e1117 100644 --- a/tfc_misc.c +++ b/tfc_misc.c @@ -116,6 +116,17 @@ char *tfc_format_time(tfc_useconds t) return r; } +char *tfc_format_pid(const char *str) +{ + static char r[128]; + size_t n; + + n = xstrlcpy(r, str, sizeof(r)); + if (show_pid == YES && sizeof(r)-n >= 22) sprintf(r+n, "[%lu]", (unsigned long)progpid); + + return r; +} + tfc_fsize tfc_fdsize(int fd) { off_t l, cur;