diff options
author | bcook <bcook@cvs.openbsd.org> | 2014-08-16 18:47:41 +0000 |
---|---|---|
committer | bcook <bcook@cvs.openbsd.org> | 2014-08-16 18:47:41 +0000 |
commit | 2fd0bfeeb93d297a7a5ed8dc39b0fbe93b8282a3 (patch) | |
tree | 6733810b23761365d7ac3b31fda9dba46e4a496f /regress | |
parent | f236fe48520c92df295fe8a2becb07ac6b0dcf74 (diff) |
replace sprintf/strdup with asprintf in engine test
Diffstat (limited to 'regress')
-rw-r--r-- | regress/lib/libcrypto/engine/enginetest.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/regress/lib/libcrypto/engine/enginetest.c b/regress/lib/libcrypto/engine/enginetest.c index 5032dc47e75..7a0b1a87519 100644 --- a/regress/lib/libcrypto/engine/enginetest.c +++ b/regress/lib/libcrypto/engine/enginetest.c @@ -95,8 +95,7 @@ static void display_engine_list(void) int main(int argc, char *argv[]) { ENGINE *block[512]; - char buf[256]; - const char *id, *name; + char *id, *name; ENGINE *ptr; int loop; int to_return = 1; @@ -207,13 +206,11 @@ int main(int argc, char *argv[]) printf("About to beef up the engine-type list\n"); for(loop = 0; loop < 512; loop++) { - sprintf(buf, "id%i", loop); - id = BUF_strdup(buf); - sprintf(buf, "Fake engine type %i", loop); - name = BUF_strdup(buf); + asprintf(&id, "id%i", loop); + asprintf(&name, "Fake engine type %i", loop); if(((block[loop] = ENGINE_new()) == NULL) || - !ENGINE_set_id(block[loop], id) || - !ENGINE_set_name(block[loop], name)) + !id || !ENGINE_set_id(block[loop], id) || + !name || !ENGINE_set_name(block[loop], name)) { printf("Couldn't create block of ENGINE structures.\n" "I'll probably also core-dump now, damn.\n"); |