From 50ea26760da4e0fcf4980e739e1d0ed520de8d59 Mon Sep 17 00:00:00 2001 From: Marcus Boerger Date: Sat, 24 Feb 2007 02:17:47 +0000 Subject: - Avoid sprintf, even when checked copy'n'paste or changes lead to errors --- ext/msql/php_msql.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'ext/msql/php_msql.c') diff --git a/ext/msql/php_msql.c b/ext/msql/php_msql.c index 4e78f120f0..196bb17461 100644 --- a/ext/msql/php_msql.c +++ b/ext/msql/php_msql.c @@ -250,9 +250,7 @@ static void php_msql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent) } convert_to_string(yyhost); host = Z_STRVAL_P(yyhost); - hashed_details_length = Z_STRLEN_P(yyhost)+4+1; - hashed_details = emalloc(hashed_details_length+1); - sprintf(hashed_details,"msql_%s",Z_STRVAL_P(yyhost)); /* SAFE */ + hashed_details_length = spprintf(&hashed_details, 0, "msql_%s",Z_STRVAL_P(yyhost)); } break; default: -- cgit v1.2.1