From: Mike Taylor Date: Tue, 3 May 2005 16:21:16 +0000 (+0000) Subject: Reliable result for connection::option() when returning a null value. X-Git-Tag: YAZPP.yazxf.1.4.1~8 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=dcd535eeb3ceaa9cfb19395f8e1780609f7c7d4b;p=yazpp-moved-to-github.git Reliable result for connection::option() when returning a null value. --- diff --git a/zoom/zconn.cpp b/zoom/zconn.cpp index 3b3137a..4c1c7a6 100644 --- a/zoom/zconn.cpp +++ b/zoom/zconn.cpp @@ -1,4 +1,4 @@ -// $Header: /home/cvsroot/yaz++/zoom/zconn.cpp,v 1.6 2003-09-22 12:25:20 mike Exp $ +// $Header: /home/cvsroot/yaz++/zoom/zconn.cpp,v 1.7 2005-05-03 16:21:16 mike Exp $ // Z39.50 Connection class @@ -23,7 +23,8 @@ namespace ZOOM { } std::string connection::option(const std::string &key) const { - return ZOOM_connection_option_get(c, key.c_str()); + const char* val = ZOOM_connection_option_get(c, key.c_str()); + return (val) ? val : std::string(); } bool connection::option(const std::string &key, const std::string &val) {