Fix handling of "host.domain" style server names in ov_server()
The old code would return "omain" rather than "domain" in this case. Also remove unneccesary checks on the return value of get_server_itsname() - this function already falls back to 'name' if 'itsname' isn't set yet.
This commit is contained in:
@@ -279,20 +279,16 @@ char *ov_server(int server)
|
|||||||
char *c;
|
char *c;
|
||||||
char *d;
|
char *d;
|
||||||
static char tmpstr[61];
|
static char tmpstr[61];
|
||||||
char *string = get_server_itsname(server);
|
const char *string = get_server_itsname(server);
|
||||||
|
|
||||||
if (!string || !*string)
|
|
||||||
string = get_server_name(server);
|
|
||||||
if (!string || !*string)
|
|
||||||
return empty_string;
|
|
||||||
strlcpy(tmpstr, string, sizeof tmpstr);
|
strlcpy(tmpstr, string, sizeof tmpstr);
|
||||||
if (!(c = strrchr(tmpstr,'.')))
|
if (!(c = strrchr(tmpstr,'.')))
|
||||||
return(string);
|
return tmpstr;
|
||||||
*c = 0;
|
*c = 0;
|
||||||
if (!(d = strrchr(tmpstr, '.')))
|
if (!(d = strrchr(tmpstr, '.')))
|
||||||
d = ++c; /* Extract domain */
|
d = c; /* Extract domain */
|
||||||
d++;
|
d++;
|
||||||
return(d);
|
return d;
|
||||||
}
|
}
|
||||||
|
|
||||||
void serversay(int save, int from_server, const char *format, ...)
|
void serversay(int save, int from_server, const char *format, ...)
|
||||||
|
|||||||
Reference in New Issue
Block a user