Commit e01edbfb authored by Ian Craggs's avatar Ian Craggs

Fix for bug #402251: fix sample code segvs

parent 4952d653
// Version: %Z% %W% %I% %E% %U%
/*******************************************************************************
* Copyright (c) 2009, 2013 IBM Corp.
*
......@@ -1087,7 +1088,7 @@ void onSend(void* context, MQTTAsync_successData* response)
void onConnectFailure(void* context, MQTTAsync_failureData* response)
{
printf("Connect failed, rc %d\n", response->code);
printf("Connect failed, rc %d\n", response ? response->code : 0);
finished = 1;
}
......@@ -1232,14 +1233,14 @@ void onSubscribe(void* context, MQTTAsync_successData* response)
void onSubscribeFailure(void* context, MQTTAsync_failureData* response)
{
printf("Subscribe failed, rc %d\n", response->code);
printf("Subscribe failed, rc %d\n", response ? response->code : 0);
finished = 1;
}
void onConnectFailure(void* context, MQTTAsync_failureData* response)
{
printf("Connect failed, rc %d\n", response->code);
printf("Connect failed, rc %d\n", response ? response->code : 0);
finished = 1;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment