From 826145e5b397af52a303e0a663dece10d2fece0e Mon Sep 17 00:00:00 2001 From: jkar8572 Date: Mon, 21 Apr 2008 15:37:42 +0000 Subject: Format string fixes (Ladislav Michnovic) --- Changelog | 1 + quota.c | 6 +++--- quota_nld.c | 6 +++--- quotacheck.c | 4 ++-- quotacheck_v2.c | 4 ++-- quotaio_xfs.c | 4 ++-- quotaops.c | 10 +++++----- quotasys.c | 8 ++++---- repquota.c | 4 ++-- 9 files changed, 24 insertions(+), 23 deletions(-) diff --git a/Changelog b/Changelog index c58548b..d703bf6 100644 --- a/Changelog +++ b/Changelog @@ -1,4 +1,5 @@ Changes in quota-tools from 3.16 to 3.17 +* fixed format strings to use "%llu" and "%lld" instead of "%Lu" and "%Ld" (Ladislav Michnovic) * removed ssl, resolv, lber from the list of LDAP libraries since we don't need them directly (Jan Kara) * added limits.h include to quota_nld (Jan Kara) diff --git a/quota.c b/quota.c index f8c8320..a96c0df 100644 --- a/quota.c +++ b/quota.c @@ -34,7 +34,7 @@ #ident "$Copyright: (c) 1980, 1990 Regents of the University of California. $" #ident "$Copyright: All rights reserved. $" -#ident "$Id: quota.c,v 1.26 2007/09/18 16:21:07 jkar8572 Exp $" +#ident "$Id: quota.c,v 1.27 2008/04/21 15:37:42 jkar8572 Exp $" /* * Disk quota reporting program. @@ -204,7 +204,7 @@ int showquotas(int type, qid_t id, int mntcnt, char **mnt) } else { if (bover) - sprintf(timebuf, "%Lu", (long long unsigned int)q->dq_dqb.dqb_btime); + sprintf(timebuf, "%llu", (long long unsigned int)q->dq_dqb.dqb_btime); else strcpy(timebuf, "0"); } @@ -222,7 +222,7 @@ int showquotas(int type, qid_t id, int mntcnt, char **mnt) } else { if (iover) - sprintf(timebuf, "%Lu", (long long unsigned int)q->dq_dqb.dqb_itime); + sprintf(timebuf, "%llu", (long long unsigned int)q->dq_dqb.dqb_itime); else strcpy(timebuf, "0"); } diff --git a/quota_nld.c b/quota_nld.c index 62bafe4..6276fc1 100644 --- a/quota_nld.c +++ b/quota_nld.c @@ -251,12 +251,12 @@ static void write_console_warning(struct quota_warning *warn) } } if (!max_atime) { - errstr(_("Failed to find tty of user %Lu to report warning to.\n"), (unsigned long long)warn->caused_id); + errstr(_("Failed to find tty of user %llu to report warning to.\n"), (unsigned long long)warn->caused_id); return; } fd = open(max_dev, O_WRONLY); if (fd < 0) { - errstr(_("Failed to open tty %s of user %Lu to report warning.\n"), dev, (unsigned long long)warn->caused_id); + errstr(_("Failed to open tty %s of user %llu to report warning.\n"), dev, (unsigned long long)warn->caused_id); return; } id2name(warn->excess_id, warn->qtype, user); @@ -288,7 +288,7 @@ static void write_console_warning(struct quota_warning *warn) } sprintf(warnbuf, "%s: %s %s %s.\r\n", level, type2name(warn->qtype), user, msg); if (write_all(fd, warnbuf, strlen(warnbuf)) < 0) - errstr(_("Failed to write quota message for user %Lu to %s: %s\n"), (unsigned long long)warn->caused_id, dev, strerror(errno)); + errstr(_("Failed to write quota message for user %llu to %s: %s\n"), (unsigned long long)warn->caused_id, dev, strerror(errno)); close(fd); } diff --git a/quotacheck.c b/quotacheck.c index 9e7d679..de1360d 100644 --- a/quotacheck.c +++ b/quotacheck.c @@ -8,7 +8,7 @@ * New quota format implementation - Jan Kara - Sponsored by SuSE CR */ -#ident "$Id: quotacheck.c,v 1.54 2008/03/13 14:49:33 jkar8572 Exp $" +#ident "$Id: quotacheck.c,v 1.55 2008/04/21 15:37:42 jkar8572 Exp $" #include #include @@ -554,7 +554,7 @@ static int scan_dir(char *pathname) if (gcheck) add_to_quota(GRPQUOTA, st.st_ino, st.st_uid, st.st_gid, st.st_mode, st.st_nlink, qspace, 1); - debug(FL_DEBUG, _("\tAdding %s size %Ld ino %d links %d uid %u gid %u\n"), de->d_name, + debug(FL_DEBUG, _("\tAdding %s size %lld ino %d links %d uid %u gid %u\n"), de->d_name, (long long)st.st_size, (int)st.st_ino, (int)st.st_nlink, (int)st.st_uid, (int)st.st_gid); files_done++; } diff --git a/quotacheck_v2.c b/quotacheck_v2.c index f567a2a..7788237 100644 --- a/quotacheck_v2.c +++ b/quotacheck_v2.c @@ -158,7 +158,7 @@ static int buffer_entry(dqbuf_t buf, uint blk, int *corrupted, uint * lblk, int if (flags & FL_GUESSDQ) { if (!(flags & (FL_DEBUG | FL_VERBOSE))) fputc('\n', stderr); - errstr(_("Found more structures for ID %u. Using values: BHARD: %Ld BSOFT: %Ld IHARD: %Ld ISOFT: %Ld\n"), + errstr(_("Found more structures for ID %u. Using values: BHARD: %lld BSOFT: %lld IHARD: %lld ISOFT: %lld\n"), (uint) id, (long long)fdq->dqb_bhardlimit, (long long)fdq->dqb_bsoftlimit, (long long)fdq->dqb_ihardlimit, (long long)fdq->dqb_isoftlimit); return 0; @@ -166,7 +166,7 @@ static int buffer_entry(dqbuf_t buf, uint blk, int *corrupted, uint * lblk, int else if (flags & FL_INTERACTIVE) { if (!(flags & (FL_DEBUG | FL_VERBOSE))) fputc('\n', stderr); - errstr(_("Found more structures for ID %u. Values: BHARD: %Ld/%Ld BSOFT: %Ld/%Ld IHARD: %Ld/%Ld ISOFT: %Ld/%Ld\n"), + errstr(_("Found more structures for ID %u. Values: BHARD: %lld/%lld BSOFT: %lld/%lld IHARD: %lld/%lld ISOFT: %lld/%lld\n"), (uint) id, (long long)fdq->dqb_bhardlimit, (long long)mdq.dqb_bhardlimit, (long long)fdq->dqb_bsoftlimit, (long long)mdq.dqb_bsoftlimit, (long long)fdq->dqb_ihardlimit, (long long)mdq.dqb_ihardlimit, diff --git a/quotaio_xfs.c b/quotaio_xfs.c index 15e75f6..e983cb9 100644 --- a/quotaio_xfs.c +++ b/quotaio_xfs.c @@ -274,7 +274,7 @@ static int xfs_report(struct quota_handle *h, int verbose) if (info->qs_uquota.qfs_ino == -1 || info->qs_uquota.qfs_ino == 0) printf(_("Inode: none\n")); else - printf(_("Inode: #%Lu (%Lu blocks, %u extents)\n"), + printf(_("Inode: #%llu (%llu blocks, %u extents)\n"), (unsigned long long)info->qs_uquota.qfs_ino, (unsigned long long)info->qs_uquota.qfs_nblks, info->qs_uquota.qfs_nextents); @@ -283,7 +283,7 @@ static int xfs_report(struct quota_handle *h, int verbose) if (info->qs_gquota.qfs_ino == -1) printf(_("Inode: none\n")); else - printf(_("Inode: #%Lu (%Lu blocks, %u extents)\n"), + printf(_("Inode: #%llu (%llu blocks, %u extents)\n"), (unsigned long long)info->qs_gquota.qfs_ino, (unsigned long long)info->qs_gquota.qfs_nblks, info->qs_gquota.qfs_nextents); diff --git a/quotaops.c b/quotaops.c index 7ff2182..b6e1747 100644 --- a/quotaops.c +++ b/quotaops.c @@ -34,7 +34,7 @@ #ident "$Copyright: (c) 1980, 1990 Regents of the University of California. $" #ident "$Copyright: All rights reserved. $" -#ident "$Id: quotaops.c,v 1.20 2006/07/21 15:14:01 jkar8572 Exp $" +#ident "$Id: quotaops.c,v 1.21 2008/04/21 15:37:42 jkar8572 Exp $" #include #include @@ -266,7 +266,7 @@ int writeprivs(struct dquot *qlist, int outfd, char *name, int quotatype) _(" Filesystem blocks soft hard inodes soft hard\n")); for (q = qlist; q; q = q->dq_next) { - fprintf(fd, " %-24s %10Lu %10Lu %10Lu %10Lu %8Lu %8Lu\n", + fprintf(fd, " %-24s %10llu %10llu %10llu %10llu %8llu %8llu\n", q->dq_h->qh_quotadev, (long long)toqb(q->dq_dqb.dqb_curspace), (long long)q->dq_dqb.dqb_bsoftlimit, @@ -344,7 +344,7 @@ int readprivs(struct dquot *qlist, int infd) fgets(line, sizeof(line), fd); while (fgets(line, sizeof(line), fd)) { - cnt = sscanf(line, "%s %Lu %Lu %Lu %Lu %Lu %Lu", + cnt = sscanf(line, "%s %llu %llu %llu %llu %llu %llu", fsp, &blocks, &bsoft, &bhard, &inodes, &isoft, &ihard); if (cnt != 7) { @@ -370,7 +370,7 @@ int readprivs(struct dquot *qlist, int infd) return -1; } - cnt = sscanf(cp, _(" blocks in use: %Lu, limits (soft = %Lu, hard = %Lu)"), + cnt = sscanf(cp, _(" blocks in use: %llu, limits (soft = %llu, hard = %llu)"), &blocks, &bsoft, &bhard); if (cnt != 3) { errstr(_("%s - %s -- bad format\n"), @@ -384,7 +384,7 @@ int readprivs(struct dquot *qlist, int infd) return -1; } - cnt = sscanf(cp, _("\tinodes in use: %Lu, limits (soft = %Lu, hard = %Lu)"), + cnt = sscanf(cp, _("\tinodes in use: %llu, limits (soft = %llu, hard = %llu)"), &inodes, &isoft, &ihard); if (cnt != 3) { errstr(_("%s - %s -- bad format\n"), diff --git a/quotasys.c b/quotasys.c index 72ce478..8d25da9 100644 --- a/quotasys.c +++ b/quotasys.c @@ -369,10 +369,10 @@ void space2str(qsize_t space, char *buf, int format) if (format) for (i = 3; i > 0; i--) if (space >= (1LL << (QUOTABLOCK_BITS*i))*100) { - sprintf(buf, "%Lu%c", (unsigned long long)(space+(1 << (QUOTABLOCK_BITS*i))-1) >> (QUOTABLOCK_BITS*i), suffix[i]); + sprintf(buf, "%llu%c", (unsigned long long)(space+(1 << (QUOTABLOCK_BITS*i))-1) >> (QUOTABLOCK_BITS*i), suffix[i]); return; } - sprintf(buf, "%Lu", (unsigned long long)space); + sprintf(buf, "%llu", (unsigned long long)space); } /* @@ -387,10 +387,10 @@ void number2str(unsigned long long num, char *buf, int format) if (format) for (i = 4, div = 1000000000000LL; i > 0; i--, div /= 1000) if (num >= 100*div) { - sprintf(buf, "%Lu%c", (num+div-1) / div, suffix[i]); + sprintf(buf, "%llu%c", (num+div-1) / div, suffix[i]); return; } - sprintf(buf, "%Lu", num); + sprintf(buf, "%llu", num); } /* diff --git a/repquota.c b/repquota.c index 4420566..fae5911 100644 --- a/repquota.c +++ b/repquota.c @@ -181,7 +181,7 @@ static void print(struct dquot *dquot, char *name) pname[PRINTNAMELEN] = 0; if (entry->dqb_bsoftlimit && toqb(entry->dqb_curspace) >= entry->dqb_bsoftlimit) if (flags & FL_RAWGRACE) - sprintf(time, "%Lu", (unsigned long long)entry->dqb_btime); + sprintf(time, "%llu", (unsigned long long)entry->dqb_btime); else difftime2str(entry->dqb_btime, time); else @@ -198,7 +198,7 @@ static void print(struct dquot *dquot, char *name) numbuf[0], numbuf[1], numbuf[2], time); if (entry->dqb_isoftlimit && entry->dqb_curinodes >= entry->dqb_isoftlimit) if (flags & FL_RAWGRACE) - sprintf(time, "%Lu", (unsigned long long)entry->dqb_itime); + sprintf(time, "%llu", (unsigned long long)entry->dqb_itime); else difftime2str(entry->dqb_itime, time); else -- cgit v1.2.3