Patch from Scott McKellar:
authormiker <miker@9efc2488-bf62-4759-914b-345cdb29e865>
Fri, 11 Apr 2008 12:13:59 +0000 (12:13 +0000)
committermiker <miker@9efc2488-bf62-4759-914b-345cdb29e865>
Fri, 11 Apr 2008 12:13:59 +0000 (12:13 +0000)
This patch elinminates the use of the osrf_clearbuf macro in several
spots.  In each case, the buffer needs to be initialized to an empty
string, because the call to jid_get_* doesn't necessarily populate it
with anything else.  In debugging mode, osrf_clearbuf() will fill the
field with exclamation points, which is not helpful in this context.

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1302 9efc2488-bf62-4759-914b-345cdb29e865

src/libopensrf/osrf_transgroup.c

index 566267b..e6a4c52 100644 (file)
@@ -89,7 +89,7 @@ int osrfTransportGroupSendMatch( osrfTransportGroup* grp, transport_message* msg
        if(!(grp && msg)) return -1;
 
        char domain[256];
-       osrf_clearbuf(domain, sizeof(domain));
+       domain[0] = '\0';
        jid_get_domain( msg->recipient, domain, 255 );
 
        osrfTransportGroupNode* node = osrfHashGet(grp->nodes, domain);
@@ -108,15 +108,15 @@ int osrfTransportGroupSend( osrfTransportGroup* grp, transport_message* msg ) {
        int bufsize = 256;
 
        char domain[bufsize];
-       osrf_clearbuf(domain, sizeof(domain));
+       domain[0] = '\0';
        jid_get_domain( msg->recipient, domain, bufsize - 1 );
 
        char msgrecip[bufsize];
-       osrf_clearbuf(msgrecip, sizeof(msgrecip));
+       msgrecip[0] = '\0';
        jid_get_username(msg->recipient, msgrecip, bufsize - 1);
 
        char msgres[bufsize];
-       osrf_clearbuf(msgres, sizeof(msgres));
+       msgres[0] = '\0';
        jid_get_resource(msg->recipient, msgres, bufsize - 1);
 
        char* firstdomain = NULL;