diff options
| author | LawrenceK <github@lklyne.co.uk> | 2013-01-16 13:41:57 +0000 |
|---|---|---|
| committer | LawrenceK <github@lklyne.co.uk> | 2013-01-16 13:41:57 +0000 |
| commit | 09dba93bb5a7ec9545f767cd651686871f8a31e0 (patch) | |
| tree | 1245853c8481ff1af5ef99d1f05133d88da37fe9 /libxrdp | |
| parent | 9335ba3db88d0979920371843a12f2231ec7eaaa (diff) | |
| download | xrdp-proprietary-09dba93bb5a7ec9545f767cd651686871f8a31e0.tar.gz xrdp-proprietary-09dba93bb5a7ec9545f767cd651686871f8a31e0.zip | |
refactor and use test2bool instead of duplicated code testing for on,yes,true, non zero
Diffstat (limited to 'libxrdp')
| -rw-r--r-- | libxrdp/xrdp_rdp.c | 31 |
1 files changed, 6 insertions, 25 deletions
diff --git a/libxrdp/xrdp_rdp.c b/libxrdp/xrdp_rdp.c index 264f6096..eff2a654 100644 --- a/libxrdp/xrdp_rdp.c +++ b/libxrdp/xrdp_rdp.c @@ -19,6 +19,7 @@ */ #include "libxrdp.h" +#include "log.h" #if defined(XRDP_FREERDP1) #include <freerdp/codec/rfx.h> @@ -87,30 +88,15 @@ xrdp_rdp_read_config(struct xrdp_client_info *client_info) if (g_strcasecmp(item, "bitmap_cache") == 0) { - if ((g_strcasecmp(value, "yes") == 0) || - (g_strcasecmp(value, "true") == 0) || - (g_strcasecmp(value, "1") == 0)) - { - client_info->use_bitmap_cache = 1; - } + client_info->use_bitmap_cache = text2bool(value); } else if (g_strcasecmp(item, "bitmap_compression") == 0) { - if (g_strcasecmp(value, "yes") == 0 || - g_strcasecmp(value, "true") == 0 || - g_strcasecmp(value, "1") == 0) - { - client_info->use_bitmap_comp = 1; - } + client_info->use_bitmap_comp = text2bool(value); } else if (g_strcasecmp(item, "bulk_compression") == 0) { - if (g_strcasecmp(value, "yes") == 0 || - g_strcasecmp(value, "true") == 0 || - g_strcasecmp(value, "1") == 0) - { - client_info->use_bulk_comp = 1; - } + client_info->use_bulk_comp = text2bool(value); } else if (g_strcasecmp(item, "crypt_level") == 0) { @@ -135,13 +121,8 @@ xrdp_rdp_read_config(struct xrdp_client_info *client_info) } else if (g_strcasecmp(item, "channel_code") == 0) { - if ((g_strcasecmp(value, "yes") == 0) || - (g_strcasecmp(value, "1") == 0) || - (g_strcasecmp(value, "true") == 0)) - { - client_info->channel_code = 1; - } - else + client_info->channel_code = text2bool(value); + if (client_info->channel_code == 0) { g_writeln("Info: All channels are disabled"); } |
