Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Brian Smith
nettle
Commits
ce32fd33
Commit
ce32fd33
authored
Oct 04, 2002
by
Niels Möller
Browse files
Use malloc, instead of asprintf.
Rev: src/nettle/examples/rsa-keygen.c:1.7
parent
5f48092d
Changes
1
Hide whitespace changes
Inline
Side-by-side
examples/rsa-keygen.c
View file @
ce32fd33
...
...
@@ -22,9 +22,6 @@
* MA 02111-1307, USA.
*/
/* For asprintf */
#define _GNU_SOURCE
#include
"buffer.h"
#include
"rsa.h"
#include
"sexp.h"
...
...
@@ -95,13 +92,16 @@ main(int argc, char **argv)
return
EXIT_FAILURE
;
}
asprintf
(
&
pub_name
,
"%s.pub"
,
priv_name
);
if
(
!
pub_name
)
pub_name
=
malloc
(
strlen
(
priv_name
)
+
5
);
if
(
pub_name
)
sprintf
(
pub_name
,
"%s.pub"
,
priv_name
);
else
{
werror
(
"Memory exhausted.
\n
"
);
return
EXIT_FAILURE
;
}
/* NOTE: No sources */
yarrow256_init
(
&
yarrow
,
0
,
NULL
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment