summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1999-04-20 11:32:41 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1999-04-20 11:32:41 +0000
commit96a3df4e7bcba9e9f504e593e8ce6586c60103de (patch)
treeefcf5574db79abd505ae86487e7d38e18b6dd184 /sbin
parent33c933036990aadc74f74d8ffaf8b4b15f5e6e27 (diff)
Merge with EOM 1.10
author: niklas Use portable malloc+snprintf instead of asprintf
Diffstat (limited to 'sbin')
-rw-r--r--sbin/isakmpd/field.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sbin/isakmpd/field.c b/sbin/isakmpd/field.c
index ea291521233..b3ac84f4b88 100644
--- a/sbin/isakmpd/field.c
+++ b/sbin/isakmpd/field.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: field.c,v 1.6 1999/04/19 19:54:53 niklas Exp $ */
-/* $EOM: field.c,v 1.9 1999/04/02 00:57:37 niklas Exp $ */
+/* $OpenBSD: field.c,v 1.7 1999/04/20 11:32:40 niklas Exp $ */
+/* $EOM: field.c,v 1.10 1999/04/20 09:23:43 niklas Exp $ */
/*
* Copyright (c) 1998, 1999 Niklas Hallqvist. All rights reserved.
@@ -121,7 +121,9 @@ field_debug_num (u_int8_t *buf, size_t len, struct constant_map **maps)
if (extract_val (buf, len, &val))
return 0;
- asprintf (&retval, "%u", val);
+ /* 3 decimal digits are enough to represent each byte. */
+ retval = malloc (3 * len);
+ snprintf (retval, 3 * len, "%u", val);
return retval;
}