summaryrefslogtreecommitdiff
path: root/ext/standard/uniqid.c
diff options
context:
space:
mode:
authorSterling Hughes <sterling@php.net>2001-08-17 09:10:49 +0000
committerSterling Hughes <sterling@php.net>2001-08-17 09:10:49 +0000
commit03724a70e91c5e8ce13960e7f7cc2dc21b771fef (patch)
tree280d243d905175b947ca63ab9fa9907806b18a57 /ext/standard/uniqid.c
parentc53f80fb23da91ce4ca42f318c9a9cdd5eedb186 (diff)
downloadphp-git-03724a70e91c5e8ce13960e7f7cc2dc21b771fef.tar.gz
Z_*_P{0,2} macro work.
Diffstat (limited to 'ext/standard/uniqid.c')
-rw-r--r--ext/standard/uniqid.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/standard/uniqid.c b/ext/standard/uniqid.c
index 741510264e..797dc44b69 100644
--- a/ext/standard/uniqid.c
+++ b/ext/standard/uniqid.c
@@ -38,7 +38,7 @@
#include "php_lcg.h"
#include "uniqid.h"
-#define MORE_ENTROPY (argc == 2 && (*flags)->value.lval)
+#define MORE_ENTROPY (argc == 2 && Z_LVAL_PP(flags))
/* {{{ proto string uniqid(string prefix, [bool more_entropy])
Generate a unique id */
@@ -60,7 +60,7 @@ PHP_FUNCTION(uniqid)
}
/* Do some bounds checking since we are using a char array. */
- if ((*prefix)->value.str.len > 114) {
+ if (Z_STRLEN_PP(prefix) > 114) {
php_error(E_WARNING, "The prefix to uniqid should not be more than 114 characters.");
return;
}
@@ -77,9 +77,9 @@ PHP_FUNCTION(uniqid)
* digits for usecs.
*/
if (MORE_ENTROPY) {
- sprintf(uniqid, "%s%08x%05x%.8f", (*prefix)->value.str.val, sec, usec, php_combined_lcg(TSRMLS_C) * 10);
+ sprintf(uniqid, "%s%08x%05x%.8f", Z_STRVAL_PP(prefix), sec, usec, php_combined_lcg(TSRMLS_C) * 10);
} else {
- sprintf(uniqid, "%s%08x%05x", (*prefix)->value.str.val, sec, usec);
+ sprintf(uniqid, "%s%08x%05x", Z_STRVAL_PP(prefix), sec, usec);
}
RETURN_STRING(uniqid, 1);