X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=liblttng-ust%2Fcompat.h;h=43b2223e43b84ad5c5dc373a8c327eb365fd32f4;hb=refs%2Fheads%2Fstable-2.5;hp=58d8585c4823eb16c7343d256777d770f6773100;hpb=9501d22f55b3a23f382f631c99b2325d1419b5da;p=lttng-ust.git diff --git a/liblttng-ust/compat.h b/liblttng-ust/compat.h index 58d8585c..43b2223e 100644 --- a/liblttng-ust/compat.h +++ b/liblttng-ust/compat.h @@ -55,7 +55,8 @@ void lttng_ust_getprocname(char *name) bsd_name = getprogname(); if (!bsd_name) name[0] = '\0'; - memcpy(name, bsd_name, LTTNG_UST_PROCNAME_LEN - 1); + else + strncpy(name, bsd_name, LTTNG_UST_PROCNAME_LEN - 1); } #endif