gallium/utils: silence strncpy warning
[mesa.git] / src / gallium / auxiliary / util / u_debug_symbol.c
index f576a51fe990956565cddcbd556c4fb4c77a1c4e..334803d008ee67fa2e6dd59db8cafd0325a75098 100644 (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;