Skip to content

Commit

Permalink
move decl to top level
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Mar 17, 2013
1 parent 53cf20a commit 08093e1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions php_fileutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,9 @@ PHP_FUNCTION(futil_filename_append_suffix)
int suffix_len;
int newfilename_len;

int len;
char *src;
char *dst;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &filename, &filename_len, &suffix, &suffix_len ) == FAILURE) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Wrong parameters.");
Expand All @@ -627,9 +630,10 @@ PHP_FUNCTION(futil_filename_append_suffix)
dot = strrchr(filename, (int) '.');
if ( dot != NULL ) {
newfilename = emalloc( sizeof(char) * (filename_len + suffix_len) );
int len = (dot - filename);
char * src = filename;
char * dst = newfilename;

len = (dot - filename);
src = filename;
dst = newfilename;

strncpy(dst, src, len);
dst += len;
Expand Down

0 comments on commit 08093e1

Please sign in to comment.