diff options
author | Matthias Eble <psychotrahe@users.sourceforge.net> | 2007-07-07 12:02:45 (GMT) |
---|---|---|
committer | Matthias Eble <psychotrahe@users.sourceforge.net> | 2007-07-07 12:02:45 (GMT) |
commit | ea6f0f5a6ee9c814fd41f64df6cfa5735d6c051a (patch) | |
tree | 196c5ada0e2997af92f95a91a11462b01d0e9b11 /plugins/utils.c | |
parent | 2208c1b7f3d0b2d949fb28a88318945d7b917858 (diff) | |
download | monitoring-plugins-ea6f0f5a6ee9c814fd41f64df6cfa5735d6c051a.tar.gz |
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
Diffstat (limited to 'plugins/utils.c')
-rw-r--r-- | plugins/utils.c | 11 |
1 files changed, 5 insertions, 6 deletions
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 * | |||
105 | clean_revstring (const char *revstring) | 105 | clean_revstring (const char *revstring) |
106 | { | 106 | { |
107 | char plugin_revision[STRLEN]; | 107 | char plugin_revision[STRLEN]; |
108 | if (sscanf (revstring,"$Revision: %[0-9.]",plugin_revision) == 1) | 108 | plugin_revision[0] = 'v'; |
109 | if (sscanf (revstring,"$Revision: %[0-9.]", plugin_revision + 1) == 1) | ||
109 | return strscpy (NULL, plugin_revision); | 110 | return strscpy (NULL, plugin_revision); |
110 | else | 111 | else |
111 | return strscpy (NULL, "N/A"); | 112 | return strscpy (NULL, "N/A"); |
112 | } | 113 | } |
113 | 114 | ||
114 | void | 115 | void |
@@ -116,10 +117,8 @@ print_revision (const char *command_name, const char *revision_string) | |||
116 | { | 117 | { |
117 | char plugin_revision[STRLEN]; | 118 | char plugin_revision[STRLEN]; |
118 | 119 | ||
119 | if (sscanf (revision_string, "$Revision: %[0-9.]", plugin_revision) != 1) | 120 | printf ("%s %s (%s %s)\n", |
120 | strncpy (plugin_revision, "N/A", STRLEN); | 121 | command_name, clean_revstring(revision_string), PACKAGE, VERSION); |
121 | printf ("%s (%s %s) %s\n", | ||
122 | command_name, PACKAGE, VERSION, plugin_revision); | ||
123 | } | 122 | } |
124 | 123 | ||
125 | const char * | 124 | const char * |