xbps-checkvers: remove magic buffer and use fwrite for %t format
This commit is contained in:
parent
dfa6e80d13
commit
26cc209225
@ -635,8 +635,7 @@ static void
|
|||||||
rcv_printf(rcv_t *rcv, FILE *fp, const char *pkgname, const char *repover,
|
rcv_printf(rcv_t *rcv, FILE *fp, const char *pkgname, const char *repover,
|
||||||
const char *srcver)
|
const char *srcver)
|
||||||
{
|
{
|
||||||
char tmpl[128], *p;
|
const char *f, *p;
|
||||||
const char *f;
|
|
||||||
|
|
||||||
for (f = rcv->format; *f; f++) {
|
for (f = rcv->format; *f; f++) {
|
||||||
if (*f == '\\') {
|
if (*f == '\\') {
|
||||||
@ -661,10 +660,8 @@ rcv_printf(rcv_t *rcv, FILE *fp, const char *pkgname, const char *repover,
|
|||||||
case 'r': fputs(repover, fp); break;
|
case 'r': fputs(repover, fp); break;
|
||||||
case 's': fputs(srcver, fp); break;
|
case 's': fputs(srcver, fp); break;
|
||||||
case 't':
|
case 't':
|
||||||
xbps_strlcpy(tmpl, rcv->fname, sizeof tmpl);
|
p = strchr(rcv->fname, '/');
|
||||||
if ((p = strchr(tmpl, '/')))
|
fwrite(rcv->fname, p ? (size_t)(p - rcv->fname) : strlen(rcv->fname), 1, fp);
|
||||||
*p = '\0';
|
|
||||||
fputs(tmpl, fp);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user