Module Name: src
Committed By: christos
Date: Wed Mar 26 18:12:46 UTC 2014
Modified Files:
src/common/lib/libprop: prop_number.c prop_string.c
Log Message:
kill sprintf
To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/common/lib/libprop/prop_number.c
cvs rdiff -u -r1.11 -r1.12 src/common/lib/libprop/prop_string.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/common/lib/libprop/prop_number.c
diff -u src/common/lib/libprop/prop_number.c:1.25 src/common/lib/libprop/prop_number.c:1.26
--- src/common/lib/libprop/prop_number.c:1.25 Fri Oct 18 14:26:20 2013
+++ src/common/lib/libprop/prop_number.c Wed Mar 26 14:12:46 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: prop_number.c,v 1.25 2013/10/18 18:26:20 martin Exp $ */
+/* $NetBSD: prop_number.c,v 1.26 2014/03/26 18:12:46 christos Exp $ */
/*-
* Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -199,9 +199,11 @@ _prop_number_externalize(struct _prop_ob
* we output in decimal.
*/
if (pn->pn_value.pnv_is_unsigned)
- sprintf(tmpstr, "0x%" PRIx64, pn->pn_value.pnv_unsigned);
+ snprintf(tmpstr, sizeof(tmpstr), "0x%" PRIx64,
+ pn->pn_value.pnv_unsigned);
else
- sprintf(tmpstr, "%" PRIi64, pn->pn_value.pnv_signed);
+ snprintf(tmpstr, sizeof(tmpstr), "%" PRIi64,
+ pn->pn_value.pnv_signed);
if (_prop_object_externalize_start_tag(ctx, "integer") == false ||
_prop_object_externalize_append_cstring(ctx, tmpstr) == false ||
Index: src/common/lib/libprop/prop_string.c
diff -u src/common/lib/libprop/prop_string.c:1.11 src/common/lib/libprop/prop_string.c:1.12
--- src/common/lib/libprop/prop_string.c:1.11 Sun Aug 3 00:00:12 2008
+++ src/common/lib/libprop/prop_string.c Wed Mar 26 14:12:46 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: prop_string.c,v 1.11 2008/08/03 04:00:12 thorpej Exp $ */
+/* $NetBSD: prop_string.c,v 1.12 2014/03/26 18:12:46 christos Exp $ */
/*-
* Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -339,7 +339,7 @@ prop_string_append(prop_string_t dst, pr
cp = _PROP_MALLOC(len + 1, M_PROP_STRING);
if (cp == NULL)
return (false);
- sprintf(cp, "%s%s", prop_string_contents(dst),
+ snprintf(cp, len + 1, "%s%s", prop_string_contents(dst),
prop_string_contents(src));
ocp = dst->ps_mutable;
dst->ps_mutable = cp;
@@ -373,7 +373,7 @@ prop_string_append_cstring(prop_string_t
cp = _PROP_MALLOC(len + 1, M_PROP_STRING);
if (cp == NULL)
return (false);
- sprintf(cp, "%s%s", prop_string_contents(dst), src);
+ snprintf(cp, len + 1, "%s%s", prop_string_contents(dst), src);
ocp = dst->ps_mutable;
dst->ps_mutable = cp;
dst->ps_size = len;