Imported Upstream version 3.3.2
[debian/amanda] / common-src / protocol.c
index da587042749e6679fc4150c9c150783612291259..932cfc3ceb7011cbe18a31c2cc61d894572c4f30 100644 (file)
@@ -159,7 +159,7 @@ protocol_sendreq(
     p->resettries = RESET_TRIES;
     p->reqtries = getconf_int(CNF_REQ_TRIES);
     p->conf_fn = conf_fn;
-    pkt_init(&p->req, P_REQ, req);
+    pkt_init(&p->req, P_REQ, "%s", req);
 
     /*
      * These are here for the caller
@@ -602,6 +602,8 @@ s_repwait(
     }
     else if(pkt->type == P_PREP) {
        p->timeout = p->repwait - CURTIME + p->curtime + 1;
+       if (p->timeout <= 0)
+           p->timeout = 1;
        return (PA_CONTPEND);
     }