summaryrefslogtreecommitdiffstats
path: root/libxrdp/xrdp_rdp.c
diff options
context:
space:
mode:
authorLawrenceK <github@lklyne.co.uk>2013-01-16 13:41:57 +0000
committerLawrenceK <github@lklyne.co.uk>2013-01-17 11:31:01 +0000
commit266db3150bfbfd8315416ba484a2e3d59b6e322d (patch)
treefdb57b1ee4bf75dad7ff3fef60bca09dceafe93a /libxrdp/xrdp_rdp.c
parente47a9cea97085a5b693bd2c9e6539bda38fa9927 (diff)
downloadxrdp-proprietary-266db3150bfbfd8315416ba484a2e3d59b6e322d.tar.gz
xrdp-proprietary-266db3150bfbfd8315416ba484a2e3d59b6e322d.zip
refactor and use test2bool instead of duplicated code testing for on,yes,true, non zero
Diffstat (limited to 'libxrdp/xrdp_rdp.c')
-rw-r--r--libxrdp/xrdp_rdp.c31
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");
}