summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0e21a36)
raw | patch | inline | side by side (parent: 0e21a36)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sun, 11 Feb 2007 11:39:22 +0000 (12:39 +0100) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sun, 11 Feb 2007 11:39:22 +0000 (12:39 +0100) |
Some systems, such as Solaris, cannot handle NULL-pointers being passed to
`printf ("%s", NULL);' or the like. This caused a crash when sending the users
plugin's values over the network under Solaris.
`printf ("%s", NULL);' or the like. This caused a crash when sending the users
plugin's values over the network under Solaris.
src/plugin.c | patch | blob | history |
diff --git a/src/plugin.c b/src/plugin.c
index 46a1c617129e957a79a28d6cfb7aec9440e5106a..d708b6bc8a6acc0ffecb47cf6575c8ab3ccaa611 100644 (file)
--- a/src/plugin.c
+++ b/src/plugin.c
*/
void plugin_submit (char *type, char *inst, char *val)
{
+ if (inst == NULL)
+ inst = "-";
+
+ if ((type == NULL) || (val == NULL))
+ {
+ DBG ("Help! NULL-pointer! type = %s; inst = %s; val = %s;",
+ (type == NULL) ? "(null)" : type,
+ inst,
+ (val == NULL) ? "(null)" : val);
+ return;
+ }
+
if (operating_mode == MODE_CLIENT)
network_send (type, inst, val);
else