develooper Front page | perl.cvs.parrot | Postings from December 2008

[svn:parrot] r34234 - trunk/compilers/imcc

From:
petdance
Date:
December 21, 2008 22:16
Subject:
[svn:parrot] r34234 - trunk/compilers/imcc
Message ID:
20081222061644.4782FCBA12@x12.develooper.com
Author: petdance
Date: Sun Dec 21 22:16:43 2008
New Revision: 34234

Modified:
   trunk/compilers/imcc/parser_util.c

Log:
Combined a strcpy/strlen together

Modified: trunk/compilers/imcc/parser_util.c
==============================================================================
--- trunk/compilers/imcc/parser_util.c	(original)
+++ trunk/compilers/imcc/parser_util.c	Sun Dec 21 22:16:43 2008
@@ -184,15 +184,15 @@
     ARGIN(SymReg * const *args), int narg, int keyvec)
 {
     int i;
+    const size_t namelen = strlen(name);
 
 #if IMC_TRACE_HIGH
-    char *full = dest;
+    const char * const full = dest;
     Parrot_io_eprintf(NULL, "op %s", name);
 #endif
 
-    strcpy(dest, name);
-
-    dest += strlen(name);
+    memcpy(dest, name, namelen+1);
+    dest += namelen;
 
     for (i = 0; i < narg && args[i]; i++) {
         *dest++ = '_';



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About