? run-tests.php ? sphinx-arginfo Index: sphinx.c =================================================================== RCS file: /repository/pecl/sphinx/sphinx.c,v retrieving revision 1.13 diff -u -p -r1.13 sphinx.c --- sphinx.c 10 Nov 2008 14:41:19 -0000 1.13 +++ sphinx.c 12 Nov 2008 08:44:43 -0000 @@ -175,7 +175,16 @@ static void php_sphinx_result_to_array(p array_init(tmp); for (i = 0; i < result->num_attrs; i++) { +#if SIZEOF_LONG == 8 add_assoc_long_ex(tmp, result->attr_names[i], strlen(result->attr_names[i]) + 1, result->attr_types[i]); +#else + float float_value; + char buf[128]; + + float_value = (float)result->attr_types[i]; + slprintf(buf, sizof(buf), "%.0f", float_value); + add_assoc_string_ex(tmp, result->attr_names[i], strlen(result->attr_names[i]) + 1, buf, 1); +#endif } add_assoc_zval_ex(*array, "attrs", sizeof("attrs"), tmp); @@ -197,7 +206,7 @@ static void php_sphinx_result_to_array(p char buf[128]; float_id = (float)sphinx_get_id(result, i); - sprintf(buf, "%.0f", float_id); + slprintf(buf, sizeof(buf), "%.0f", float_id); add_assoc_string_ex(tmp_element, "id", sizeof("id"), buf, 1); #endif } @@ -249,7 +258,7 @@ static void php_sphinx_result_to_array(p int buf_len; float_id = (float)sphinx_get_id(result, i); - buf_len = sprintf(buf, "%.0f", float_id); + buf_len = slprintf(buf, sizeof(buf), "%.0f", float_id); add_assoc_zval_ex(tmp, buf, buf_len + 1, tmp_element); #endif }