summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbcook <>2014-08-16 18:47:40 +0000
committerbcook <>2014-08-16 18:47:40 +0000
commitcd072a630de628b8b117efa93c814542270d5ebe (patch)
tree131f6a3a43bb5df009a5dd160957a2b812621254
parent98469e1608c075636fa47a174471eb83ad35c83d (diff)
downloadopenbsd-cd072a630de628b8b117efa93c814542270d5ebe.tar.gz
openbsd-cd072a630de628b8b117efa93c814542270d5ebe.tar.bz2
openbsd-cd072a630de628b8b117efa93c814542270d5ebe.zip
replace sprintf/strdup with asprintf in engine test
-rw-r--r--src/regress/lib/libcrypto/engine/enginetest.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/regress/lib/libcrypto/engine/enginetest.c b/src/regress/lib/libcrypto/engine/enginetest.c
index 5032dc47e7..7a0b1a8751 100644
--- a/src/regress/lib/libcrypto/engine/enginetest.c
+++ b/src/regress/lib/libcrypto/engine/enginetest.c
@@ -95,8 +95,7 @@ static void display_engine_list(void)
95int main(int argc, char *argv[]) 95int main(int argc, char *argv[])
96 { 96 {
97 ENGINE *block[512]; 97 ENGINE *block[512];
98 char buf[256]; 98 char *id, *name;
99 const char *id, *name;
100 ENGINE *ptr; 99 ENGINE *ptr;
101 int loop; 100 int loop;
102 int to_return = 1; 101 int to_return = 1;
@@ -207,13 +206,11 @@ int main(int argc, char *argv[])
207 printf("About to beef up the engine-type list\n"); 206 printf("About to beef up the engine-type list\n");
208 for(loop = 0; loop < 512; loop++) 207 for(loop = 0; loop < 512; loop++)
209 { 208 {
210 sprintf(buf, "id%i", loop); 209 asprintf(&id, "id%i", loop);
211 id = BUF_strdup(buf); 210 asprintf(&name, "Fake engine type %i", loop);
212 sprintf(buf, "Fake engine type %i", loop);
213 name = BUF_strdup(buf);
214 if(((block[loop] = ENGINE_new()) == NULL) || 211 if(((block[loop] = ENGINE_new()) == NULL) ||
215 !ENGINE_set_id(block[loop], id) || 212 !id || !ENGINE_set_id(block[loop], id) ||
216 !ENGINE_set_name(block[loop], name)) 213 !name || !ENGINE_set_name(block[loop], name))
217 { 214 {
218 printf("Couldn't create block of ENGINE structures.\n" 215 printf("Couldn't create block of ENGINE structures.\n"
219 "I'll probably also core-dump now, damn.\n"); 216 "I'll probably also core-dump now, damn.\n");