summaryrefslogtreecommitdiff
path: root/floattest.c
diff options
context:
space:
mode:
authorChris Kuethe <chris.kuethe@gmail.com>2006-11-10 15:59:15 +0000
committerChris Kuethe <chris.kuethe@gmail.com>2006-11-10 15:59:15 +0000
commit31ca6329c4338f8aaa4fcf3b30b38a132c7c5862 (patch)
tree6e95d6714f78403830e3e8b800f4b318be2029d0 /floattest.c
parent290f7680469738b9b5acebaa253760b728691804 (diff)
downloadgpsd-31ca6329c4338f8aaa4fcf3b30b38a132c7c5862.tar.gz
Bounded string functions.
Diffstat (limited to 'floattest.c')
-rw-r--r--floattest.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/floattest.c b/floattest.c
index 554feaa8..7fbe8082 100644
--- a/floattest.c
+++ b/floattest.c
@@ -37,14 +37,14 @@ int main(void) {
g = a + b * c; /* multiply and add */
e = b + c; /* add */
f = d * e; /* multiply */
- sprintf(try1,
+ snprintf(try1, 64,
"%.2f %.2f %.2f %.2f %.2f %.2f %.2f", a, b, c, d, e, f, g);
A = 3.0; B = 5.0 ; C = 7.0; D = 11.0;
G = A + B * C; /* multiply and add */
E = B + C; /* add */
F = D * E; /* multiply */
- sprintf(try2,
+ snprintf(try2, 64,
"%.2f %.2f %.2f %.2f %.2f %.2f %.2f", A, B, C, D, E, F, G);
puts("Floating Point test - the next 3 lines should be the same");