From 19022ee7547839690948a7a9807930a7891f3f15 Mon Sep 17 00:00:00 2001 From: midipix Date: Sat, 10 Feb 2024 02:50:51 +0000 Subject: code base: simplify checks against value returned from snprintf() via wrapper. --- src/fallback/slbt_archive_import_mri.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/fallback/slbt_archive_import_mri.c') diff --git a/src/fallback/slbt_archive_import_mri.c b/src/fallback/slbt_archive_import_mri.c index 76a4c06..fdcbf07 100644 --- a/src/fallback/slbt_archive_import_mri.c +++ b/src/fallback/slbt_archive_import_mri.c @@ -21,6 +21,7 @@ #include "slibtool_dprintf_impl.h" #include "slibtool_symlink_impl.h" #include "slibtool_readlink_impl.h" +#include "slibtool_snprintf_impl.h" #include "slibtool_errinfo_impl.h" #define PPRIX64 "%"PRIx64 @@ -46,8 +47,8 @@ static char * slbt_mri_argument( mricwd,sizeof(mricwd)) < 0) return 0; - if ((size_t)snprintf(dstbuf,sizeof(dstbuf),"%s/%s", - mricwd,arg) >= sizeof(dstbuf)) + if (slbt_snprintf(dstbuf,sizeof(dstbuf), + "%s/%s",mricwd,arg) < 0) return 0; target = dstbuf; @@ -123,9 +124,8 @@ int slbt_archive_import_mri( return 0; /* program */ - if ((size_t)snprintf(program,sizeof(program), - "%s",dctx->cctx->host.ar) - >= sizeof(program)) + if (slbt_snprintf(program,sizeof(program), + "%s",dctx->cctx->host.ar) < 0) return SLBT_BUFFER_ERROR(dctx); /* fork */ -- cgit v1.2.3