summaryrefslogtreecommitdiffstats
path: root/common/os_calls.c
diff options
context:
space:
mode:
authorJay Sorg <jay.sorg@gmail.com>2016-12-04 15:39:10 -0800
committerJay Sorg <jay.sorg@gmail.com>2016-12-04 15:39:10 -0800
commit9a517b34f0f4eb546c46ad4185260f4b66773a8c (patch)
treeacba9d4d05b0b495cfe628fb585001837407e371 /common/os_calls.c
parent57905d71ada103ae397e441e2c14b6f64c365a69 (diff)
downloadxrdp-proprietary-9a517b34f0f4eb546c46ad4185260f4b66773a8c.tar.gz
xrdp-proprietary-9a517b34f0f4eb546c46ad4185260f4b66773a8c.zip
vnc: code cleanup
Diffstat (limited to 'common/os_calls.c')
-rw-r--r--common/os_calls.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/common/os_calls.c b/common/os_calls.c
index d8e711b8..9ebaa880 100644
--- a/common/os_calls.c
+++ b/common/os_calls.c
@@ -2531,6 +2531,34 @@ g_htoi(char *str)
}
/*****************************************************************************/
+/* returns number of bytes copied into out_str */
+int APP_CC
+g_bytes_to_hexstr(const void *bytes, int num_bytes, char *out_str,
+ int bytes_out_str)
+{
+ int rv;
+ int index;
+ char *lout_str;
+ const tui8 *lbytes;
+
+ rv = 0;
+ lbytes = (const tui8 *) bytes;
+ lout_str = out_str;
+ for (index = 0; index < num_bytes; index++)
+ {
+ if (bytes_out_str < 3)
+ {
+ break;
+ }
+ g_snprintf(lout_str, bytes_out_str, "%2.2x", lbytes[index]);
+ lout_str += 2;
+ bytes_out_str -= 2;
+ rv += 2;
+ }
+ return rv;
+}
+
+/*****************************************************************************/
int APP_CC
g_pos(const char *str, const char *to_find)
{