Author: mysqlpp
Date: Sat Jul 31 23:15:12 2010
New Revision: 2673

URL: http://svn.gna.org/viewcvs/mysqlpp?rev=2673&view=rev
Log:
Fixed a crash in CommandLine mechanism when usage message is called up
for programs that have no "extra" parameter and corresponding usage
appendage.  Initial patch by "Crazy Pete" <[email protected]>, fixed
and extended by me.

Modified:
    trunk/lib/cmdline.cpp

Modified: trunk/lib/cmdline.cpp
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/cmdline.cpp?rev=2673&r1=2672&r2=2673&view=diff
==============================================================================
--- trunk/lib/cmdline.cpp (original)
+++ trunk/lib/cmdline.cpp Sat Jul 31 23:15:12 2010
@@ -238,12 +238,12 @@
 {
        std::cout << "usage: " << program_name() <<
                        " [-s server_addr] [-u user] [-p password] " <<
-                       extra << std::endl;
+                       (extra ? extra : "") << std::endl;
        std::cout << std::endl;
        std::cout << "    If no options are given, connects to database "
                        "server on localhost" << std::endl;
        std::cout << "    using your user name and no password." << std::endl;
-       if (strlen(extra) > 0) {
+       if (extra && (strlen(extra) > 0)) {
                std::cout << std::endl;
                std::cout << "    The extra parameter " << extra <<
                                " is required, regardless of which" << 
std::endl;


_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits

Reply via email to