summaryrefslogtreecommitdiff
path: root/ext/sybase_ct/php_sybase_ct.c
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2007-02-24 02:17:47 +0000
committerMarcus Boerger <helly@php.net>2007-02-24 02:17:47 +0000
commit50ea26760da4e0fcf4980e739e1d0ed520de8d59 (patch)
tree888a32ce58864f5318a7f1072f8526c6a99212f9 /ext/sybase_ct/php_sybase_ct.c
parent3e262bd36989898ac01224f0a987e79f44d25b31 (diff)
downloadphp-git-50ea26760da4e0fcf4980e739e1d0ed520de8d59.tar.gz
- Avoid sprintf, even when checked copy'n'paste or changes lead to errors
Diffstat (limited to 'ext/sybase_ct/php_sybase_ct.c')
-rw-r--r--ext/sybase_ct/php_sybase_ct.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/ext/sybase_ct/php_sybase_ct.c b/ext/sybase_ct/php_sybase_ct.c
index 8cd752dded..10358c96c4 100644
--- a/ext/sybase_ct/php_sybase_ct.c
+++ b/ext/sybase_ct/php_sybase_ct.c
@@ -996,8 +996,7 @@ PHP_FUNCTION(sybase_select_db)
ZEND_FETCH_RESOURCE2(sybase_ptr, sybase_link *, sybase_link_index, id, "Sybase-Link", le_link, le_plink);
convert_to_string_ex(db);
- cmdbuf = (char *) emalloc(sizeof("use ")+Z_STRLEN_PP(db)+1);
- sprintf(cmdbuf, "use %s", Z_STRVAL_PP(db)); /* SAFE */
+ spprintf(&cmdbuf, 0, "use %s", Z_STRVAL_PP(db)); /* SAFE */
if (exec_cmd(sybase_ptr, cmdbuf)==FAILURE) {
efree(cmdbuf);
@@ -2115,16 +2114,16 @@ PHP_MINFO_FUNCTION(sybase)
php_info_print_table_start();
php_info_print_table_header(2, "Sybase_CT Support", "enabled" );
- sprintf(buf, "%ld", SybCtG(num_persistent));
+ snprintf(buf, sizeof(buf), "%ld", SybCtG(num_persistent));
php_info_print_table_row(2, "Active Persistent Links", buf);
- sprintf(buf, "%ld", SybCtG(num_links));
+ snprintf(buf, sizeof(buf), "%ld", SybCtG(num_links));
php_info_print_table_row(2, "Active Links", buf);
- sprintf(buf, "%ld", SybCtG(min_server_severity));
+ snprintf(buf, sizeof(buf), "%ld", SybCtG(min_server_severity));
php_info_print_table_row(2, "Min server severity", buf);
- sprintf(buf, "%ld", SybCtG(min_client_severity));
+ snprintf(buf, sizeof(buf), "%ld", SybCtG(min_client_severity));
php_info_print_table_row(2, "Min client severity", buf);
php_info_print_table_row(2, "Application Name", SybCtG(appname));
- sprintf(buf, "%ld", SybCtG(deadlock_retry_count));
+ snprintf(buf, sizeof(buf), "%ld", SybCtG(deadlock_retry_count));
php_info_print_table_row(2, "Deadlock retry count", buf);
php_info_print_table_end();