com php-src: Add one more check to skip getting into code that will do nothing: ext/mysqli/mysqli_api.c

From: Date: Tue, 20 May 2014 11:50:50 +0000
Subject: com php-src: Add one more check to skip getting into code that will do nothing: ext/mysqli/mysqli_api.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-78480@lists.php.net to get a copy of this message
Commit: 90cad3de2f4a4969d56ada43791e40ab64208ed9 Author: Andrey Hristov <andrey@php.net> Tue, 20 May 2014 14:50:50 +0300 Parents: e6e5d3535dc767cadd9d962e41dd837bd58a2ad3 Branches: phpng Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=90cad3de2f4a4969d56ada43791e40ab64208ed9 Log: Add one more check to skip getting into code that will do nothing Changed paths: M ext/mysqli/mysqli_api.c Diff: diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c index 45456d2..1b2c799 100644 --- a/ext/mysqli/mysqli_api.c +++ b/ext/mysqli/mysqli_api.c @@ -40,24 +40,24 @@ static void mysqli_tx_cor_options_to_string(const MYSQL * const conn, smart_str * str, const unsigned int mode) { if (mode & TRANS_COR_AND_CHAIN && !(mode & TRANS_COR_AND_NO_CHAIN)) { - if (str->s) { + if (str->s && str->s->len) { smart_str_appendl(str, " ", sizeof(" ") - 1); } smart_str_appendl(str, "AND CHAIN", sizeof("AND CHAIN") - 1); } else if (mode & TRANS_COR_AND_NO_CHAIN && !(mode & TRANS_COR_AND_CHAIN)) { - if (str->s) { + if (str->s && str->s->len) { smart_str_appendl(str, " ", sizeof(" ") - 1); } smart_str_appendl(str, "AND NO CHAIN", sizeof("AND NO CHAIN") - 1); } if (mode & TRANS_COR_RELEASE && !(mode & TRANS_COR_NO_RELEASE)) { - if (str->s) { + if (str->s && str->s->len) { smart_str_appendl(str, " ", sizeof(" ") - 1); } smart_str_appendl(str, "RELEASE", sizeof("RELEASE") - 1); } else if (mode & TRANS_COR_NO_RELEASE && !(mode & TRANS_COR_RELEASE)) { - if (str->s) { + if (str->s && str->s->len) { smart_str_appendl(str, " ", sizeof(" ") - 1); } smart_str_appendl(str, "NO RELEASE", sizeof("NO RELEASE") - 1);

« previous php.cvs (#78480) next »