rx-packet-version-not-all-kernels-have-snprintf-20010721
authorGarry Zacheiss <zacheiss@mit.edu>
Sat, 21 Jul 2001 08:07:51 +0000 (08:07 +0000)
committerDerrick Brashear <shadow@dementia.org>
Sat, 21 Jul 2001 08:07:51 +0000 (08:07 +0000)
linux kernel for instance has no snprintf

src/rx/rx_packet.c

index 5cdf7de..ce17d1e 100644 (file)
@@ -1407,7 +1407,7 @@ struct rx_packet *rxi_ReceiveVersionPacket(ap, asocket, ahost, aport, istack)
        ap->header.flags = ap->header.flags & ~RX_CLIENT_INITIATED;
        rxi_EncodePacketHeader(ap);
        bzero(buf, sizeof(buf));
-       snprintf(buf, sizeof(buf), "%s", cml_version_number+4);
+       strncpy(buf, cml_version_number+4, sizeof(buf)-1);
        rx_packetwrite(ap, 0, 65, buf);
        tl = ap->length;
        ap->length = 65;