* file named AUTHORS, in the root directory of this distribution.
*/
/*
- * $Id: packet.c,v 1.8.2.4 2006/12/18 20:43:50 martinea Exp $
+ * $Id: packet.c,v 1.8 2006/05/25 01:47:12 johnfranks Exp $
*
* Routines for modifying the amanda protocol packet type
*/
assert(pkt != NULL);
assert(strcmp(pkt_type2str(type), "BOGUS") != 0);
- assert(fmt != NULL);
+ if(fmt == NULL)
+ fmt = "";
pkt->type = type;
pkt->packet_size = 1000;
pkt->body = alloc(pkt->packet_size);
while(1) {
arglist_start(argp, fmt);
- len = vsnprintf(pkt->body, pkt->packet_size, fmt, argp);
+ len = g_vsnprintf(pkt->body, pkt->packet_size, fmt, argp);
arglist_end(argp);
if (len > -1 && len < (int)(pkt->packet_size - 1))
break;
while(1) {
arglist_start(argp, fmt);
- lenX = vsnprintf(pkt->body + len, pkt->packet_size - len, fmt,argp);
+ lenX = g_vsnprintf(pkt->body + len, pkt->packet_size - len, fmt,argp);
arglist_end(argp);
if (lenX > -1 && lenX < (int)(pkt->packet_size - len - 1))
break;