From ea6f0f5a6ee9c814fd41f64df6cfa5735d6c051a Mon Sep 17 00:00:00 2001 From: Matthias Eble Date: Sat, 7 Jul 2007 12:02:45 +0000 Subject: Changed output order of print_revision print_revision now uses clean_revstring git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1752 f882894a-f735-0410-b71e-b25c423dba1c diff --git a/plugins/utils.c b/plugins/utils.c index 7e1e58a..0e79fbd 100644 --- a/plugins/utils.c +++ b/plugins/utils.c @@ -105,10 +105,11 @@ char * 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 @@ print_revision (const char *command_name, const char *revision_string) { 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 * -- cgit v0.10-9-g596f