work around glibc bug: printf("%.*s", INT_MAX, s) tries to allocate 2G.

This commit is contained in:
Oswald Buddenhagen 2006-07-29 11:52:54 +00:00
parent 9b7c09e4b6
commit d2463a4cd8
2 changed files with 2 additions and 2 deletions

View File

@ -662,7 +662,7 @@ maildir_scan( maildir_store_t *ctx, msglist_t *msglist )
if (u)
ml = u - entry->base;
else
ru = "", ml = INT_MAX;
ru = "", ml = sizeof(buf);
fnl = nfsnprintf( buf + bl, sizeof(buf) - bl, "%s/%.*s,U=%d%s", subdirs[entry->recent], ml, entry->base, uid, ru ) + 1 - 4;
memcpy( nbuf, buf, bl + 4 );
nfsnprintf( nbuf + bl + 4, sizeof(nbuf) - bl - 4, "%s", entry->base );

View File

@ -154,7 +154,7 @@ convert( const char *box, int altmap )
if (u)
ml = u - e->d_name;
else
ru = "", ml = INT_MAX;
ru = "", ml = sizeof(buf);
if (altmap) {
if (!p)
continue;