GUACAMOLE-630: Disallow NULL color schemes.
A color scheme string should always be provided, even if blank. Disallowing NULL allows assumptions to be made which simplifies the logic surrounding persisting provided configuration values.
This commit is contained in:
parent
b5191caddc
commit
0516d599cf
@ -197,7 +197,7 @@ void guac_terminal_parse_color_scheme(guac_client* client,
|
||||
guac_terminal_color (*palette)[256]) {
|
||||
|
||||
/* Special cases. */
|
||||
if (color_scheme == NULL || color_scheme[0] == '\0') {
|
||||
if (color_scheme[0] == '\0') {
|
||||
/* guac_terminal_parse_color_scheme defaults to gray-black */
|
||||
}
|
||||
else if (strcmp(color_scheme, GUAC_TERMINAL_SCHEME_GRAY_BLACK) == 0) {
|
||||
|
@ -561,8 +561,8 @@ struct guac_terminal {
|
||||
*
|
||||
* @param color_scheme
|
||||
* The name of the color scheme to use. This string must be one of the
|
||||
* names defined by the GUAC_TERMINAL_SCHEME_* constants. If blank or NULL,
|
||||
* the default scheme of GUAC_TERMINAL_SCHEME_GRAY_BLACK will be used. If
|
||||
* names defined by the GUAC_TERMINAL_SCHEME_* constants. If blank, the
|
||||
* default scheme of GUAC_TERMINAL_SCHEME_GRAY_BLACK will be used. If
|
||||
* invalid, a warning will be logged, and the terminal will fall back on
|
||||
* GUAC_TERMINAL_SCHEME_GRAY_BLACK.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user