Skip to content

Commit 51e3bef

Browse files
committed
remove xbps_strl{cat,cpy} and use strl{cat,cpy} directly
1 parent cf5afa8 commit 51e3bef

File tree

26 files changed

+168
-178
lines changed

26 files changed

+168
-178
lines changed

bin/xbps-alternatives/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,9 @@ main(int argc, char **argv)
230230
memset(&xh, 0, sizeof(xh));
231231
xh.state_cb = state_cb;
232232
if (rootdir)
233-
xbps_strlcpy(xh.rootdir, rootdir, sizeof(xh.rootdir));
233+
strlcpy(xh.rootdir, rootdir, sizeof(xh.rootdir));
234234
if (confdir)
235-
xbps_strlcpy(xh.confdir, confdir, sizeof(xh.confdir));
235+
strlcpy(xh.confdir, confdir, sizeof(xh.confdir));
236236

237237
xh.flags = flags;
238238

bin/xbps-checkvers/main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,10 @@ rcv_init(rcv_t *rcv, const char *prog)
113113
assert(rcv->cache);
114114

115115
if (rcv->xbps_conf != NULL) {
116-
xbps_strlcpy(rcv->xhp.confdir, rcv->xbps_conf, sizeof(rcv->xhp.confdir));
116+
strlcpy(rcv->xhp.confdir, rcv->xbps_conf, sizeof(rcv->xhp.confdir));
117117
}
118118
if (rcv->rootdir != NULL) {
119-
xbps_strlcpy(rcv->xhp.rootdir, rcv->rootdir, sizeof(rcv->xhp.rootdir));
119+
strlcpy(rcv->xhp.rootdir, rcv->rootdir, sizeof(rcv->xhp.rootdir));
120120
}
121121
if (xbps_init(&rcv->xhp) != 0)
122122
abort();
@@ -820,8 +820,8 @@ main(int argc, char **argv)
820820
if ((p = strrchr(argv[i], '/')) && (strcmp(p, "/template")) == 0) {
821821
tmpl = argv[i];
822822
} else {
823-
xbps_strlcat(tmp, argv[i], sizeof tmp);
824-
xbps_strlcat(tmp, "/template", sizeof tmp);
823+
strlcat(tmp, argv[i], sizeof tmp);
824+
strlcat(tmp, "/template", sizeof tmp);
825825
tmpl = tmp;
826826
}
827827
rcv_process_file(&rcv, tmpl, rcv_check_version);

bin/xbps-dgraph/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -598,9 +598,9 @@ main(int argc, char **argv)
598598
/* Initialize libxbps */
599599
memset(&xh, 0, sizeof(xh));
600600
if (rootdir != NULL)
601-
xbps_strlcpy(xh.rootdir, rootdir, sizeof(xh.rootdir));
601+
strlcpy(xh.rootdir, rootdir, sizeof(xh.rootdir));
602602
if (confdir)
603-
xbps_strlcpy(xh.confdir, confdir, sizeof(xh.confdir));
603+
strlcpy(xh.confdir, confdir, sizeof(xh.confdir));
604604

605605
xh.flags = flags;
606606
if ((rv = xbps_init(&xh)) != 0)

bin/xbps-install/main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,11 @@ main(int argc, char **argv)
216216
xh.fetch_cb = fetch_file_progress_cb;
217217
xh.fetch_cb_data = &xfer;
218218
if (rootdir)
219-
xbps_strlcpy(xh.rootdir, rootdir, sizeof(xh.rootdir));
219+
strlcpy(xh.rootdir, rootdir, sizeof(xh.rootdir));
220220
if (cachedir)
221-
xbps_strlcpy(xh.cachedir, cachedir, sizeof(xh.cachedir));
221+
strlcpy(xh.cachedir, cachedir, sizeof(xh.cachedir));
222222
if (confdir)
223-
xbps_strlcpy(xh.confdir, confdir, sizeof(xh.confdir));
223+
strlcpy(xh.confdir, confdir, sizeof(xh.confdir));
224224
xh.flags = flags;
225225
if (flags & XBPS_FLAG_VERBOSE)
226226
xh.unpack_cb = unpack_progress_cb;

bin/xbps-pkgdb/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,9 @@ main(int argc, char **argv)
144144

145145
memset(&xh, 0, sizeof(xh));
146146
if (rootdir)
147-
xbps_strlcpy(xh.rootdir, rootdir, sizeof(xh.rootdir));
147+
strlcpy(xh.rootdir, rootdir, sizeof(xh.rootdir));
148148
if (confdir)
149-
xbps_strlcpy(xh.confdir, confdir, sizeof(xh.confdir));
149+
strlcpy(xh.confdir, confdir, sizeof(xh.confdir));
150150
xh.flags = flags;
151151

152152
if ((rv = xbps_init(&xh)) != 0) {

bin/xbps-query/main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,11 +241,11 @@ main(int argc, char **argv)
241241
* Initialize libxbps.
242242
*/
243243
if (rootdir)
244-
xbps_strlcpy(xh.rootdir, rootdir, sizeof(xh.rootdir));
244+
strlcpy(xh.rootdir, rootdir, sizeof(xh.rootdir));
245245
if (cachedir)
246-
xbps_strlcpy(xh.cachedir, cachedir, sizeof(xh.cachedir));
246+
strlcpy(xh.cachedir, cachedir, sizeof(xh.cachedir));
247247
if (confdir)
248-
xbps_strlcpy(xh.confdir, confdir, sizeof(xh.confdir));
248+
strlcpy(xh.confdir, confdir, sizeof(xh.confdir));
249249

250250
xh.flags = flags;
251251

bin/xbps-reconfigure/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,9 @@ main(int argc, char **argv)
168168
memset(&xh, 0, sizeof(xh));
169169
xh.state_cb = state_cb;
170170
if (rootdir)
171-
xbps_strlcpy(xh.rootdir, rootdir, sizeof(xh.rootdir));
171+
strlcpy(xh.rootdir, rootdir, sizeof(xh.rootdir));
172172
if (confdir)
173-
xbps_strlcpy(xh.confdir, confdir, sizeof(xh.confdir));
173+
strlcpy(xh.confdir, confdir, sizeof(xh.confdir));
174174

175175
xh.flags = flags;
176176

bin/xbps-remove/clean-cache.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ static int
4343
binpkg_parse(char *buf, size_t bufsz, const char *path, const char **pkgver, const char **arch)
4444
{
4545
char *p;
46-
size_t n = xbps_strlcpy(buf, path, bufsz);
46+
size_t n = strlcpy(buf, path, bufsz);
4747
if (n >= bufsz)
4848
return -ENOBUFS;
4949

bin/xbps-remove/main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,11 @@ main(int argc, char **argv)
251251
memset(&xh, 0, sizeof(xh));
252252
xh.state_cb = state_cb_rm;
253253
if (rootdir)
254-
xbps_strlcpy(xh.rootdir, rootdir, sizeof(xh.rootdir));
254+
strlcpy(xh.rootdir, rootdir, sizeof(xh.rootdir));
255255
if (cachedir)
256-
xbps_strlcpy(xh.cachedir, cachedir, sizeof(xh.cachedir));
256+
strlcpy(xh.cachedir, cachedir, sizeof(xh.cachedir));
257257
if (confdir)
258-
xbps_strlcpy(xh.confdir, confdir, sizeof(xh.confdir));
258+
strlcpy(xh.confdir, confdir, sizeof(xh.confdir));
259259

260260
xh.flags = flags;
261261

bin/xbps-uhelper/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,9 @@ main(int argc, char **argv)
146146
xh.fetch_cb_data = &xfer;
147147
xh.flags = flags;
148148
if (rootdir)
149-
xbps_strlcpy(xh.rootdir, rootdir, sizeof(xh.rootdir));
149+
strlcpy(xh.rootdir, rootdir, sizeof(xh.rootdir));
150150
if (confdir)
151-
xbps_strlcpy(xh.confdir, confdir, sizeof(xh.confdir));
151+
strlcpy(xh.confdir, confdir, sizeof(xh.confdir));
152152
if ((rv = xbps_init(&xh)) != 0) {
153153
xbps_error_printf("xbps-uhelper: failed to "
154154
"initialize libxbps: %s.\n", strerror(rv));

0 commit comments

Comments
 (0)