--- libaitmqtt/example/cmds.c 2012/04/26 15:26:37 1.1.1.1.2.1 +++ libaitmqtt/example/cmds.c 2012/04/27 15:15:12 1.1.1.1.2.2 @@ -49,8 +49,7 @@ main() for (i = 0; i < m->msg_len; i++) printf("%d\n", ((u_char*) m->msg_base)[i]); len = sizeof message; - hdr = mqtt_readPUBLISH(m, topic, sizeof topic, &msgID, message, &len); - if (!hdr) { + if (!mqtt_readPUBLISH(m, topic, sizeof topic, &msgID, message, &len)) { printf("Error:: mqtt_readPUBLISH() #%d - %s\n", mqtt_GetErrno(), mqtt_GetError()); return 2; }