Applications might pass NULL for the buffer, and input modules might
accept it (or just cope). Eliminate a potential NULL dereference in
the emission of diagnostics messages.
*/
SR_API int sr_input_send(const struct sr_input *in, GString *buf)
{
- sr_spew("Sending %" G_GSIZE_FORMAT " bytes to %s module.",
- buf->len, in->module->id);
+ size_t len;
+
+ len = buf ? buf->len : 0;
+ sr_spew("Sending %zu bytes to %s module.", len, in->module->id);
return in->module->receive((struct sr_input *)in, buf);
}