From: Pierre-Eric Pelloux-Prayer Date: Thu, 16 Apr 2020 08:24:24 +0000 (+0200) Subject: gallium/utils: silence strncpy warning X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=07071cac7b97b20ba3b5a633171af7ac8ac09d00;p=mesa.git gallium/utils: silence strncpy warning Reviewed-by: Marek Olšák Part-of: --- diff --git a/src/gallium/auxiliary/util/u_debug_symbol.c b/src/gallium/auxiliary/util/u_debug_symbol.c index f576a51fe99..334803d008e 100644 --- a/src/gallium/auxiliary/util/u_debug_symbol.c +++ b/src/gallium/auxiliary/util/u_debug_symbol.c @@ -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;