Skip to content

Commit 334b8dd

Browse files
authored
Merge pull request datastax#126 from remicollet/issue-format
Issue format
2 parents 5406ad3 + fd60ca8 commit 334b8dd

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

ext/php_driver.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ throw_invalid_argument(zval *object,
325325
if (cls_name) {
326326
zend_throw_exception_ex(php_driver_invalid_argument_exception_ce, 0 TSRMLS_CC,
327327
"%s must be %s, an instance of %.*s given",
328-
object_name, expected_type, cls_len, cls_name);
328+
object_name, expected_type, (int)cls_len, cls_name);
329329
#if PHP_MAJOR_VERSION >= 7
330330
zend_string_release(str);
331331
#else
@@ -367,7 +367,11 @@ PHP_INI_MH(OnUpdateLogLevel)
367367
} else {
368368
php_error_docref(NULL TSRMLS_CC, E_NOTICE,
369369
PHP_DRIVER_NAME " | Unknown log level '%s', using 'ERROR'",
370+
#if PHP_MAJOR_VERSION >= 7
371+
ZSTR_VAL(new_value));
372+
#else
370373
new_value);
374+
#endif
371375
cass_log_set_level(CASS_LOG_ERROR);
372376
}
373377
}

ext/src/FutureSession.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ PHP_METHOD(FutureSession, get)
3737

3838
if (self->exception_message) {
3939
zend_throw_exception_ex(exception_class(self->exception_code),
40-
self->exception_code TSRMLS_CC, self->exception_message);
40+
self->exception_code TSRMLS_CC, "%s", self->exception_message);
4141
return;
4242
}
4343

@@ -71,7 +71,7 @@ PHP_METHOD(FutureSession, get)
7171
}
7272

7373
zend_throw_exception_ex(exception_class(self->exception_code),
74-
self->exception_code TSRMLS_CC, self->exception_message);
74+
self->exception_code TSRMLS_CC, "%s", self->exception_message);
7575
return;
7676
}
7777

0 commit comments

Comments
 (0)