[Nagiosplug-checkins] nagiosplug/plugins utils.c,1.51,1.52

Matthias Eble psychotrahe at users.sourceforge.net
Sat Jul 7 14:02:47 CEST 2007


Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv23536

Modified Files:
	utils.c 
Log Message:
Changed output order of print_revision
print_revision now uses clean_revstring


Index: utils.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/utils.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- utils.c	28 Jan 2007 21:46:41 -0000	1.51
+++ utils.c	7 Jul 2007 12:02:45 -0000	1.52
@@ -105,10 +105,11 @@
 clean_revstring (const char *revstring)
 {
 	char plugin_revision[STRLEN];
-	if (sscanf (revstring,"$Revision: %[0-9.]",plugin_revision) == 1)
+	plugin_revision[0] = 'v';
+	if (sscanf (revstring,"$Revision: %[0-9.]", plugin_revision + 1) == 1)
 		return strscpy (NULL, plugin_revision);
 	else
-	  return strscpy (NULL, "N/A");
+		return strscpy (NULL, "N/A");
 }
 
 void
@@ -116,10 +117,8 @@
 {
 	char plugin_revision[STRLEN];
 
-	if (sscanf (revision_string, "$Revision: %[0-9.]", plugin_revision) != 1)
-		strncpy (plugin_revision, "N/A", STRLEN);
-	printf ("%s (%s %s) %s\n",
-					command_name, PACKAGE, VERSION, plugin_revision);
+	printf ("%s %s (%s %s)\n",
+	         command_name, clean_revstring(revision_string), PACKAGE, VERSION);
 }
 
 const char *





More information about the Commits mailing list