MFC: if data is NULL, don't pass that to userland as (null)

Approved by: re@ (scottl)
This commit is contained in:
imp 2005-10-06 23:15:18 +00:00
parent 6e436f7dec
commit 0fcbe9db41

View File

@ -553,8 +553,12 @@ devctl_notify(const char *system, const char *subsystem, const char *type,
msg = malloc(len, M_BUS, M_NOWAIT);
if (msg == NULL)
return; /* Drop it on the floor */
snprintf(msg, len, "!system=%s subsystem=%s type=%s %s\n", system,
subsystem, type, data);
if (data != NULL)
snprintf(msg, len, "!system=%s subsystem=%s type=%s %s\n",
system, subsystem, type, data);
else
snprintf(msg, len, "!system=%s subsystem=%s type=%s\n",
system, subsystem, type);
devctl_queue_data(msg);
}