mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-04-15 22:00:06 -04:00
modify the is_pg_dbname() function to allow databases with '-' in their name.
reference: sf tracker #1500752 git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1414 f882894a-f735-0410-b71e-b25c423dba1c
This commit is contained in:
parent
84abd4c3ea
commit
73255d1551
1 changed files with 2 additions and 2 deletions
|
|
@ -329,9 +329,9 @@ is_pg_dbname (char *dbname)
|
|||
return (FALSE);
|
||||
strncpy (txt, dbname, NAMEDATALEN - 1);
|
||||
txt[NAMEDATALEN - 1] = 0;
|
||||
if (sscanf (txt, "%[_a-zA-Z]%[^_a-zA-Z0-9]", tmp, tmp) == 1)
|
||||
if (sscanf (txt, "%[_a-zA-Z]%[^_a-zA-Z0-9-]", tmp, tmp) == 1)
|
||||
return (TRUE);
|
||||
if (sscanf (txt, "%[_a-zA-Z]%[_a-zA-Z0-9]%[^_a-zA-Z0-9]", tmp, tmp, tmp) ==
|
||||
if (sscanf (txt, "%[_a-zA-Z]%[_a-zA-Z0-9-]%[^_a-zA-Z0-9-]", tmp, tmp, tmp) ==
|
||||
2) return (TRUE);
|
||||
return (FALSE);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue