Permalink
Browse files

Only call strlen(lc_fname) if we are going to use the result

  • Loading branch information...
1 parent d7f91bc commit 052d0057c2d96f013dbc3a477a46a10672db9094 @ojwb ojwb committed Feb 17, 2014
Showing with 1 addition and 2 deletions.
  1. +1 −2 Lib/php/director.swg
View
@@ -102,12 +102,11 @@ namespace Swig {
TSRMLS_FETCH_FROM_CTX(swig_zts_ctx);
zend_class_entry **ce;
zend_function *mptr;
- int name_len = strlen(lc_fname);
if (zend_lookup_class(cname, strlen(cname), &ce TSRMLS_CC) != SUCCESS) {
return false;
}
- if (zend_hash_find(&(*ce)->function_table, lc_fname, name_len + 1, (void **) &mptr) != SUCCESS) {
+ if (zend_hash_find(&(*ce)->function_table, lc_fname, strlen(lc_fname) + 1, (void **) &mptr) != SUCCESS) {
return false;
}
// common.scope points to the declaring class

0 comments on commit 052d005

Please sign in to comment.