Module Name: src Committed By: cegger Date: Tue Apr 28 05:44:43 UTC 2009
Modified Files: src/sys/arch/xen/xenbus: xenbus_client.c xenbus_xs.c Log Message: sprintf -> snprintf To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/arch/xen/xenbus/xenbus_client.c cvs rdiff -u -r1.17 -r1.18 src/sys/arch/xen/xenbus/xenbus_xs.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/xen/xenbus/xenbus_client.c diff -u src/sys/arch/xen/xenbus/xenbus_client.c:1.9 src/sys/arch/xen/xenbus/xenbus_client.c:1.10 --- src/sys/arch/xen/xenbus/xenbus_client.c:1.9 Fri Sep 5 13:37:24 2008 +++ src/sys/arch/xen/xenbus/xenbus_client.c Tue Apr 28 05:44:43 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: xenbus_client.c,v 1.9 2008/09/05 13:37:24 tron Exp $ */ +/* $NetBSD: xenbus_client.c,v 1.10 2009/04/28 05:44:43 cegger Exp $ */ /****************************************************************************** * Client-facing interface for the Xenbus driver. In other words, the * interface between the Xenbus and the device-specific code, be it the @@ -29,7 +29,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: xenbus_client.c,v 1.9 2008/09/05 13:37:24 tron Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xenbus_client.c,v 1.10 2009/04/28 05:44:43 cegger Exp $"); #if 0 #define DPRINTK(fmt, args...) \ @@ -170,7 +170,7 @@ if (printf_buffer == NULL) goto fail; - len = sprintf(printf_buffer, "%i ", -err); + len = snprintf(printf_buffer, PRINTF_BUFFER_SIZE, "%i ", -err); ret = vsnprintf(printf_buffer+len, PRINTF_BUFFER_SIZE-len, fmt, ap); KASSERT(len + ret < PRINTF_BUFFER_SIZE); Index: src/sys/arch/xen/xenbus/xenbus_xs.c diff -u src/sys/arch/xen/xenbus/xenbus_xs.c:1.17 src/sys/arch/xen/xenbus/xenbus_xs.c:1.18 --- src/sys/arch/xen/xenbus/xenbus_xs.c:1.17 Wed Oct 29 13:53:15 2008 +++ src/sys/arch/xen/xenbus/xenbus_xs.c Tue Apr 28 05:44:43 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: xenbus_xs.c,v 1.17 2008/10/29 13:53:15 cegger Exp $ */ +/* $NetBSD: xenbus_xs.c,v 1.18 2009/04/28 05:44:43 cegger Exp $ */ /****************************************************************************** * xenbus_xs.c * @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: xenbus_xs.c,v 1.17 2008/10/29 13:53:15 cegger Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xenbus_xs.c,v 1.18 2009/04/28 05:44:43 cegger Exp $"); #if 0 #define DPRINTK(fmt, args...) \ @@ -651,7 +651,7 @@ int err; int s; - sprintf(token, "%lX", (long)watch); + snprintf(token, sizeof(token), "%lX", (long)watch); s = spltty(); @@ -681,7 +681,7 @@ char token[sizeof(watch) * 2 + 1]; int err, s; - sprintf(token, "%lX", (long)watch); + snprintf(token, sizeof(token), "%lX", (long)watch); s = spltty(); @@ -725,7 +725,7 @@ char token[sizeof(watch) * 2 + 1]; /* No need for watches_lock: the suspend_mutex is sufficient. */ SLIST_FOREACH(watch, &watches, watch_next) { - sprintf(token, "%lX", (long)watch); + snprintf(token, sizeof(token), "%lX", (long)watch); xs_watch(watch->node, token); }