Thomas Pöchtrager 2020-03-14 17:51:11 +01:00
parent 4e1faecce8
commit 606eb7dcb2
4 changed files with 22 additions and 5 deletions

View File

@ -375,6 +375,15 @@ put_arobj(cfp, sb)
size = chdr.size;
}
/* cctools-port */
if (strlen(hb) != sizeof(HDR)) {
fprintf(stderr, "ar is not working correctly. "
"Please report this issue to the cctools-port "
"project. Thank you.\n");
exit(1);
}
/* cctools-port end */
if (write(cfp->wfd, hb, sizeof(HDR)) != sizeof(HDR))
error(cfp->wname);
/*

View File

@ -113,12 +113,18 @@ typedef struct {
char name[MAXNAMLEN + 1]; /* name */
} CHDR;
/*
* cctools-port:
* Replaced 'qd' with 'lld' in format strings
* https://github.com/tpoechtrager/osxcross/issues/216#issuecomment-599044727
* */
/* Header format strings. */
#define HDR1 "%s%-13d%-12ld%-6u%-6u%-8o%-10qd%2s"
#define HDR2 "%-16.16s%-12ld%-6u%-6u%-8o%-10qd%2s"
#define HDR1 "%s%-13d%-12ld%-6u%-6u%-8o%-10lld%2s"
#define HDR2 "%-16.16s%-12ld%-6u%-6u%-8o%-10lld%2s"
#define OLDARMAXNAME 15
#define HDR3 "%-16.15s%-12ld%-6u%-6u%-8o%-10qd%2s"
#define HDR3 "%-16.15s%-12ld%-6u%-6u%-8o%-10lld%2s"
#include <sys/cdefs.h>

View File

@ -107,7 +107,8 @@ contents(argv)
goto next;
if (options & AR_V) {
(void)strmode(chdr.mode, buf);
(void)printf("%s %6d/%-6d %8qd ",
/* cctools-port: replaced 'qd' with 'lld' in format string */
(void)printf("%s %6d/%-6d %8lld ",
buf + 1, chdr.uid, chdr.gid, chdr.size);
tp = localtime(&chdr.date);
(void)strftime(buf, sizeof(buf), "%b %e %H:%M %Y", tp);

View File

@ -236,5 +236,6 @@ const char *format,
void
sprint_value (char *buf, signed_expr_t val)
{
sprintf (buf, "%qd", val);
/* cctools-port: Replaced 'qd' with 'lld' in format string */
sprintf (buf, "%lld", val);
}