cvs: php4 /ext/com conversion.c
| From: | Harald Radi | Date: | Wed, 18 Jul 2001 19:56:17 +0000 |
| Subject: | cvs: php4 /ext/com conversion.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-6256@lists.php.net to get a copy of this message | ||
phanto Wed Jul 18 15:56:17 2001 EDT
Modified files:
/php4/ext/com conversion.c
Log:
fixed a bug in 'case VT_DATE'
Index: php4/ext/com/conversion.c
diff -u php4/ext/com/conversion.c:1.23 php4/ext/com/conversion.c:1.24
--- php4/ext/com/conversion.c:1.23 Sun Jul 15 15:03:03 2001
+++ php4/ext/com/conversion.c Wed Jul 18 15:56:17 2001
@@ -44,7 +44,6 @@
PHPAPI char *php_OLECHAR_to_char(OLECHAR *unicode_str, uint *out_length, int persistent, int
codepage);
/* implementations */
-
PHPAPI void php_pval_to_variant(pval *pval_arg, VARIANT *var_arg, int codepage)
{
OLECHAR *unicode_str;
@@ -242,6 +241,7 @@
struct tm *phptime;
phptime = gmtime(&(pval_arg->value.lval));
+ memset(&wintime, 0, sizeof(wintime));
wintime.wYear = phptime->tm_year + 1900;
wintime.wMonth = phptime->tm_mon + 1;
@@ -252,6 +252,7 @@
SystemTimeToVariantTime(&wintime, &V_DATE(var_arg));
}
+ break;
case VT_BSTR:
convert_to_string_ex(&pval_arg);
@@ -339,6 +340,7 @@
struct tm *phptime;
phptime = gmtime(&(pval_arg->value.lval));
+ memset(&wintime, 0, sizeof(wintime));
wintime.wYear = phptime->tm_year + 1900;
wintime.wMonth = phptime->tm_mon + 1;
@@ -349,6 +351,7 @@
SystemTimeToVariantTime(&wintime, var_arg->pdate);
}
+ break;
case VT_BSTR|VT_BYREF:
convert_to_string(pval_arg);
@@ -442,7 +445,7 @@
break;
default:
- php_error(E_WARNING, "Type not supportet or not yet implemented.");
+ php_error(E_WARNING, "Type not supported or not yet implemented.");
}
}
@@ -473,7 +476,7 @@
if (1 != (Dims = SafeArrayGetDim(array)))
{
php_error(E_WARNING,"Unsupported: multi-dimensional (%d) SafeArrays", Dims);
- ZVAL_FALSE(pval_arg);
+ ZVAL_NULL(pval_arg);
return FAILURE;
}
SafeArrayLock( array);
@@ -552,7 +555,7 @@
else switch(var_arg->vt & ~VT_BYREF)
{
case VT_EMPTY:
- pval_arg->type = IS_NULL;
+ ZVAL_NULL(pval_arg);
break;
case VT_UI1:
@@ -692,6 +695,8 @@
{
VariantTimeToSystemTime(V_DATE(var_arg), &wintime);
}
+
+ memset(&phptime, 0, sizeof(phptime));
phptime.tm_year = wintime.wYear - 1900;
phptime.tm_mon = wintime.wMonth - 1;