summaryrefslogtreecommitdiff
path: root/src/internal/slibtool_symlink_impl.c
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2024-02-10 02:50:51 +0000
committermidipix <writeonce@midipix.org>2024-02-10 03:01:55 +0000
commit19022ee7547839690948a7a9807930a7891f3f15 (patch)
tree782384fd6f5c56272efdfd29533a623937fe9ea6 /src/internal/slibtool_symlink_impl.c
parent2f8d3eabcf743d1e398277e7b4e6a03bbdd574ee (diff)
downloadslibtool-19022ee7547839690948a7a9807930a7891f3f15.tar.bz2
slibtool-19022ee7547839690948a7a9807930a7891f3f15.tar.xz
code base: simplify checks against value returned from snprintf() via wrapper.
Diffstat (limited to 'src/internal/slibtool_symlink_impl.c')
-rw-r--r--src/internal/slibtool_symlink_impl.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/internal/slibtool_symlink_impl.c b/src/internal/slibtool_symlink_impl.c
index 27f8171..19ec8ee 100644
--- a/src/internal/slibtool_symlink_impl.c
+++ b/src/internal/slibtool_symlink_impl.c
@@ -13,6 +13,7 @@
#include "slibtool_errinfo_impl.h"
#include "slibtool_symlink_impl.h"
#include "slibtool_readlink_impl.h"
+#include "slibtool_snprintf_impl.h"
#define SLBT_DEV_NULL_FLAGS (SLBT_DRIVER_ALL_STATIC \
| SLBT_DRIVER_DISABLE_SHARED \
@@ -70,13 +71,14 @@ int slbt_create_symlink(
dotdot = fwrapper ? "../" : "";
/* atarget */
- if ((size_t)snprintf(atarget,sizeof(atarget),"%s%s",
- dotdot,slash) >= sizeof(atarget))
+ if (slbt_snprintf(atarget,sizeof(atarget),
+ "%s%s",dotdot,slash) < 0)
return SLBT_BUFFER_ERROR(dctx);
/* tmplnk */
- if ((size_t)snprintf(tmplnk,sizeof(tmplnk),"%s.symlink.tmp",
- lnkname) >= sizeof(tmplnk))
+ if (slbt_snprintf(tmplnk,sizeof(tmplnk),
+ "%s.symlink.tmp",
+ lnkname) <0)
return SLBT_BUFFER_ERROR(dctx);
/* placeholder? */