[Pkg-privacy-commits] [libotr] 92/225: Change two malloc+strcpy into strdup
Ximin Luo
infinity0 at moszumanska.debian.org
Sat Aug 22 12:45:02 UTC 2015
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch master
in repository libotr.
commit fe3db7bb8ef060050357f096e5b5c88010598a14
Author: Ian Goldberg <iang at cs.uwaterloo.ca>
Date: Fri Jul 20 06:17:44 2012 -0400
Change two malloc+strcpy into strdup
Just to make it a bit cleaner
---
src/instag.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/instag.c b/src/instag.c
index 18143f5..8878007 100644
--- a/src/instag.c
+++ b/src/instag.c
@@ -207,10 +207,8 @@ gcry_error_t otrl_instag_generate_FILEp(OtrlUserState us, FILE *instf,
if (!accountname || !protocol) return gcry_error(GPG_ERR_NO_ERROR);
p = (OtrlInsTag *)malloc(sizeof(OtrlInsTag));
- p->accountname = malloc(strlen(accountname)+1);
- p->protocol = malloc(strlen(protocol)+1);
- strcpy(p->accountname, accountname);
- strcpy(p->protocol, protocol);
+ p->accountname = strdup(accountname);
+ p->protocol = strdup(protocol);
p->instag = otrl_instag_get_new();
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/libotr.git
More information about the Pkg-privacy-commits
mailing list