mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 20:18:12 +02:00
gallivm: ensure string is null-terminated instead of assert()ing
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
This commit is contained in:
parent
1cc17fb731
commit
f5b41f9121
1 changed files with 1 additions and 3 deletions
|
|
@ -108,9 +108,7 @@ lp_build_print_value(struct gallivm_state *gallivm,
|
|||
type_fmt[5] = '\0';
|
||||
} else if (type_kind == LLVMIntegerTypeKind) {
|
||||
if (LLVMGetIntTypeWidth(type_ref) == 64) {
|
||||
unsigned flen = strlen(PRId64);
|
||||
assert(flen <= 3);
|
||||
strncpy(type_fmt + 2, PRId64, flen);
|
||||
util_snprintf(type_fmt + 2, 3, "%s", PRId64);
|
||||
} else if (LLVMGetIntTypeWidth(type_ref) == 8) {
|
||||
type_fmt[2] = 'u';
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue