diff options
author | Arnaud Versini <arnaud.versini@gmail.com> | 2014-05-09 10:38:04 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-05-20 09:47:54 +0200 |
commit | cd11bc699ac50af4f560ed5f2e5e7903de0898b8 (patch) | |
tree | 2b5683460af2b171212bb766deb4cb7ee5858d4e /rsc | |
parent | 498c314861f0913a5b31ee29efc38aad12c3a781 (diff) |
C string usage improvment
Change-Id: I5c59f0d2d1b911ffa1ee251e0f1355d137616493
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'rsc')
-rw-r--r-- | rsc/source/rscpp/cpp3.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/rsc/source/rscpp/cpp3.c b/rsc/source/rscpp/cpp3.c index b14f4f85a3b9..40635ed9f951 100644 --- a/rsc/source/rscpp/cpp3.c +++ b/rsc/source/rscpp/cpp3.c @@ -387,8 +387,7 @@ readoptions(char* filename, char*** pfargv) *poptbuff=EOS; if (strlen(optbuff)>0) { - pfa[fargc+1]=malloc(strlen(optbuff)+1); - strcpy(pfa[fargc+1],optbuff); + pfa[fargc+1]=strdup(optbuff); fargc++; pfa[fargc+1]=0; poptbuff=&optbuff[0]; |