diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-03-24 08:09:46 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-03-24 08:09:46 +0300 |
commit | 16694ed408a533fcf275db8f92a5d0c7c0cbd854 (patch) | |
tree | 98ff1da567ee52d58cadf455e443d99536437c1f /source/blender/gpu/intern/gpu_texture.c | |
parent | 79f67acccb36fd67f534b75f1d0f7e0799080c24 (diff) |
Cleanup: redundant use of string formatting functions
Diffstat (limited to 'source/blender/gpu/intern/gpu_texture.c')
-rw-r--r-- | source/blender/gpu/intern/gpu_texture.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/source/blender/gpu/intern/gpu_texture.c b/source/blender/gpu/intern/gpu_texture.c index e2aa26c3b33..5398db82586 100644 --- a/source/blender/gpu/intern/gpu_texture.c +++ b/source/blender/gpu/intern/gpu_texture.c @@ -645,10 +645,12 @@ GPUTexture *GPU_texture_create_nD( tex->bindcode = GPU_tex_alloc(); if (!tex->bindcode) { - if (err_out) - BLI_snprintf(err_out, 256, "GPUTexture: texture create failed\n"); - else + if (err_out) { + BLI_strncpy(err_out, "GPUTexture: texture create failed\n", 256); + } + else { fprintf(stderr, "GPUTexture: texture create failed\n"); + } GPU_texture_free(tex); return NULL; } @@ -685,7 +687,7 @@ GPUTexture *GPU_texture_create_nD( if (!valid) { if (err_out) { - BLI_snprintf(err_out, 256, "GPUTexture: texture alloc failed\n"); + BLI_strncpy(err_out, "GPUTexture: texture alloc failed\n", 256); } else { fprintf(stderr, "GPUTexture: texture alloc failed. Likely not enough Video Memory.\n"); @@ -790,10 +792,12 @@ static GPUTexture *GPU_texture_cube_create( tex->bindcode = GPU_tex_alloc(); if (!tex->bindcode) { - if (err_out) - BLI_snprintf(err_out, 256, "GPUTexture: texture create failed\n"); - else + if (err_out) { + BLI_strncpy(err_out, "GPUTexture: texture create failed\n", 256); + } + else { fprintf(stderr, "GPUTexture: texture create failed\n"); + } GPU_texture_free(tex); return NULL; } |