[Nagiosplug-devel] [ nagiosplug-Bugs-1310495 ] check_snmp.c Doesn't Compile on RH7.3

SourceForge.net noreply at sourceforge.net
Fri Jan 13 11:36:05 CET 2006


Bugs item #1310495, was opened at 2005-10-01 17:09
Message generated for change (Comment added) made by alierak
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1310495&group_id=29880

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Craig Orsinger (cjorsinger)
Assigned to: Nobody/Anonymous (nobody)
Summary: check_snmp.c Doesn't Compile on RH7.3

Initial Comment:
Because there's a local variable declared in the middle
of a while loop, this source file won't compile on
RedHat 7.3. The error was introduced in nagios-plugins
version 1.4.1, and still exists in version 1.4.2.

I've attempted to attach a patch file that fixes this.


----------------------------------------------------------------------

Comment By: Robby Griffin (alierak)
Date: 2006-01-13 14:35

Message:
Logged In: YES 
user_id=83996

Well, no, sourceforge won't let me attach a file to someone else's bug report, 
so here you go:

--- nagios-plugins-1.4.2/plugins/check_snmp.c.orig      Wed Jun  1 15:41:
01 2005
+++ nagios-plugins-1.4.2/plugins/check_snmp.c   Thu Jan 12 18:22:
47 2006
@@ -337,10 +337,17 @@
                        asprintf (&outbuff, "%s %s", outbuff, unitv[i]);
 
                i++;
-
+#if 0
                char *str[MAX_INPUT_BUFFER];
                asprintf(str, "=%s%s;;;; ", show, type ? type : "");
                strcat(perfstr, *str);
+#else
+               strcat(perfstr, "=");
+               strcat(perfstr, show);
+               if (type)
+                       strcat(perfstr, type);
+               strcat(perfstr, ";;;; ");
+#endif
 
        }       /* end while (ptr) */
 


----------------------------------------------------------------------

Comment By: Robby Griffin (alierak)
Date: 2006-01-13 14:33

Message:
Logged In: YES 
user_id=83996

Still exists in CVS, too, and also won't compile on NetBSD 1.6.

I don't like this variable declaration at all, btw, because it's an array of 
pointers to strings, which the program then uses as if it were a pointer to a 
string. I'll attach an alternate patch which eliminates the declaration entirely.

----------------------------------------------------------------------

Comment By: Jeremy D Pavleck (judg3)
Date: 2005-11-19 00:50

Message:
Logged In: YES 
user_id=510182

exact same problem on Solaris 9.
The patch fixed it.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1310495&group_id=29880




More information about the Devel mailing list