gallium/utils: silence strncpy warning

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4584>
This commit is contained in:
Pierre-Eric Pelloux-Prayer 2020-04-16 10:24:24 +02:00
parent dbfeec62c3
commit 07071cac7b

View file

@ -234,7 +234,7 @@ debug_symbol_name_glibc(const void *addr, char* buf, unsigned size)
if (!syms) {
return FALSE;
}
strncpy(buf, syms[0], size);
strncpy(buf, syms[0], size - 1);
buf[size - 1] = 0;
free(syms);
return TRUE;