@@ -68,9 +68,6 @@ static void imap_warn(const char *, ...);
68
68
69
69
static char * next_arg (char * * );
70
70
71
- __attribute__((format (printf , 3 , 4 )))
72
- static int nfsnprintf (char * buf , int blen , const char * fmt , ...);
73
-
74
71
static int nfvasprintf (char * * strp , const char * fmt , va_list ap )
75
72
{
76
73
int len ;
@@ -500,19 +497,6 @@ static char *next_arg(char **s)
500
497
return ret ;
501
498
}
502
499
503
- __attribute__((format (printf , 3 , 4 )))
504
- static int nfsnprintf (char * buf , int blen , const char * fmt , ...)
505
- {
506
- int ret ;
507
- va_list va ;
508
-
509
- va_start (va , fmt );
510
- if (blen <= 0 || (unsigned )(ret = vsnprintf (buf , blen , fmt , va )) >= (unsigned )blen )
511
- BUG ("buffer too small. Please report a bug." );
512
- va_end (va );
513
- return ret ;
514
- }
515
-
516
500
static struct imap_cmd * issue_imap_cmd (struct imap_store * ctx ,
517
501
struct imap_cmd_cb * cb ,
518
502
const char * fmt , va_list ap )
@@ -535,11 +519,11 @@ static struct imap_cmd *issue_imap_cmd(struct imap_store *ctx,
535
519
get_cmd_result (ctx , NULL );
536
520
537
521
if (!cmd -> cb .data )
538
- bufl = nfsnprintf (buf , sizeof (buf ), "%d %s\r\n" , cmd -> tag , cmd -> cmd );
522
+ bufl = xsnprintf (buf , sizeof (buf ), "%d %s\r\n" , cmd -> tag , cmd -> cmd );
539
523
else
540
- bufl = nfsnprintf (buf , sizeof (buf ), "%d %s{%d%s}\r\n" ,
541
- cmd -> tag , cmd -> cmd , cmd -> cb .dlen ,
542
- CAP (LITERALPLUS ) ? "+" : "" );
524
+ bufl = xsnprintf (buf , sizeof (buf ), "%d %s{%d%s}\r\n" ,
525
+ cmd -> tag , cmd -> cmd , cmd -> cb .dlen ,
526
+ CAP (LITERALPLUS ) ? "+" : "" );
543
527
544
528
if (0 < verbosity ) {
545
529
if (imap -> num_in_progress )
0 commit comments