Doesn't the zval contain info about the length of the string?

-- 

// DvDmanDT
mail: dvdmandt¤telia.com
msn: dvdmandt¤hotmail.com
"Ci" <[EMAIL PROTECTED]> skrev i meddelandet 
news:[EMAIL PROTECTED]
> Stefan Esser napisa³(a):
>> No. The correct way for getting the variable is
>>
>>
>> zval **data;
>> ...
>> if (zend_hash_find(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]),
>> "DOCUMENT_ROOT", sizeof("DOCUMENT_ROOT"), &data)==SUCCESS) {
>>     ...
>>     strlcpy(buffer, Z_STRVAL_PP(data), sizeof(buffer));
>> }
> I tried to use it. I figured out that zend_hash_find function returns 
> SUCCESS, but when the strlcpy is executed I can't do anything after that. 
> I'm thinking about writing results to file.
> I used:
>
> FILE *log;
> log = fopen("/var/log/mail_spam", "w");
>
> fprintf(log, "data: %s", buffer);
>
> It writes any data I want but only when I don't execute strlcpy (or 
> strcpy) function. What could be the problem? 

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to