Skip to content

Commit d7d62c3

Browse files
committed
Avoid strncpy warning.
1 parent 421dc35 commit d7d62c3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

memtrail.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ _dladdr (const void *address, Dl_info *info) {
196196
if (progname[0] == 0) {
197197
size_t len = readlink("/proc/self/exe", progname, sizeof progname - 1);
198198
if (len <= 0) {
199-
strncpy(progname, program_invocation_name, PATH_MAX);
199+
strncpy(progname, program_invocation_name, PATH_MAX - 1);
200200
len = PATH_MAX - 1;
201201
}
202202
progname[len] = 0;

0 commit comments

Comments
 (0)