pathtrace.c: use xsprintf instead of sprintf
* pathtrace.c: Include "xstring.h". (getfdpath): Replace sprintf with xsprintf.
This commit is contained in:
parent
e0d0dec788
commit
ffeaaa44c0
@ -32,6 +32,7 @@
|
||||
#include <poll.h>
|
||||
|
||||
#include "syscall.h"
|
||||
#include "xstring.h"
|
||||
|
||||
struct path_set global_path_set;
|
||||
|
||||
@ -105,7 +106,7 @@ getfdpath(struct tcb *tcp, int fd, char *buf, unsigned bufsize)
|
||||
if (fd < 0)
|
||||
return -1;
|
||||
|
||||
sprintf(linkpath, "/proc/%u/fd/%u", tcp->pid, fd);
|
||||
xsprintf(linkpath, "/proc/%u/fd/%u", tcp->pid, fd);
|
||||
n = readlink(linkpath, buf, bufsize - 1);
|
||||
/*
|
||||
* NB: if buf is too small, readlink doesn't fail,
|
||||
|
Loading…
x
Reference in New Issue
Block a user