diff --git a/common/base64.c b/common/base64.c index 55f92401..a5b83dfa 100644 --- a/common/base64.c +++ b/common/base64.c @@ -22,7 +22,7 @@ #include #endif -#include "os_calls.h" +#include "string_calls.h" #include #include diff --git a/common/file.c b/common/file.c index b796f5b0..3a66bba3 100644 --- a/common/file.c +++ b/common/file.c @@ -24,6 +24,7 @@ #include "arch.h" #include "os_calls.h" +#include "string_calls.h" #include "list.h" #include "file.h" #include "parse.h" diff --git a/common/list.c b/common/list.c index 8224c353..4597b9cb 100644 --- a/common/list.c +++ b/common/list.c @@ -24,6 +24,7 @@ #include "arch.h" #include "os_calls.h" +#include "string_calls.h" #include "list.h" /*****************************************************************************/ diff --git a/common/os_calls.c b/common/os_calls.c index 6f3bd219..897dd5a1 100644 --- a/common/os_calls.c +++ b/common/os_calls.c @@ -76,7 +76,7 @@ #endif #include "os_calls.h" -#include "arch.h" +#include "string_calls.h" #include "log.h" /* for clearenv() */ @@ -2509,518 +2509,6 @@ g_file_get_size(const char *filename) #endif } -/*****************************************************************************/ -/* returns length of text */ -int -g_strlen(const char *text) -{ - if (text == NULL) - { - return 0; - } - - return strlen(text); -} - -/*****************************************************************************/ -/* locates char in text */ -const char * -g_strchr(const char* text, int c) -{ - if (text == NULL) - { - return 0; - } - - return strchr(text,c); -} - -/*****************************************************************************/ -/* returns dest */ -char * -g_strcpy(char *dest, const char *src) -{ - if (src == 0 && dest != 0) - { - dest[0] = 0; - return dest; - } - - if (dest == 0 || src == 0) - { - return 0; - } - - return strcpy(dest, src); -} - -/*****************************************************************************/ -/* returns dest */ -char * -g_strncpy(char *dest, const char *src, int len) -{ - char *rv; - - if (src == 0 && dest != 0) - { - dest[0] = 0; - return dest; - } - - if (dest == 0 || src == 0) - { - return 0; - } - - rv = strncpy(dest, src, len); - dest[len] = 0; - return rv; -} - -/*****************************************************************************/ -/* returns dest */ -char * -g_strcat(char *dest, const char *src) -{ - if (dest == 0 || src == 0) - { - return dest; - } - - return strcat(dest, src); -} - -/*****************************************************************************/ -/* returns dest */ -char * -g_strncat(char *dest, const char *src, int len) -{ - if (dest == 0 || src == 0) - { - return dest; - } - - return strncat(dest, src, len); -} - -/*****************************************************************************/ -/* if in = 0, return 0 else return newly alloced copy of in */ -char * -g_strdup(const char *in) -{ - int len; - char *p; - - if (in == 0) - { - return 0; - } - - len = g_strlen(in); - p = (char *)g_malloc(len + 1, 0); - - if (p != NULL) - { - g_strcpy(p, in); - } - - return p; -} - -/*****************************************************************************/ -/* if in = 0, return 0 else return newly alloced copy of input string - * if the input string is larger than maxlen the returned string will be - * truncated. All strings returned will include null termination*/ -char * -g_strndup(const char *in, const unsigned int maxlen) -{ - unsigned int len; - char *p; - - if (in == 0) - { - return 0; - } - - len = g_strlen(in); - - if (len > maxlen) - { - len = maxlen - 1; - } - - p = (char *)g_malloc(len + 2, 0); - - if (p != NULL) - { - g_strncpy(p, in, len + 1); - } - - return p; -} - -/*****************************************************************************/ -int -g_strcmp(const char *c1, const char *c2) -{ - return strcmp(c1, c2); -} - -/*****************************************************************************/ -int -g_strncmp(const char *c1, const char *c2, int len) -{ - return strncmp(c1, c2, len); -} - -/*****************************************************************************/ -/* compare up to delim */ -int -g_strncmp_d(const char *s1, const char *s2, const char delim, int n) -{ - char c1; - char c2; - - c1 = 0; - c2 = 0; - while (n > 0) - { - c1 = *(s1++); - c2 = *(s2++); - if ((c1 == 0) || (c1 != c2) || (c1 == delim) || (c2 == delim)) - { - return c1 - c2; - } - n--; - } - return c1 - c2; -} - -/*****************************************************************************/ -int -g_strcasecmp(const char *c1, const char *c2) -{ -#if defined(_WIN32) - return stricmp(c1, c2); -#else - return strcasecmp(c1, c2); -#endif -} - -/*****************************************************************************/ -int -g_strncasecmp(const char *c1, const char *c2, int len) -{ -#if defined(_WIN32) - return strnicmp(c1, c2, len); -#else - return strncasecmp(c1, c2, len); -#endif -} - -/*****************************************************************************/ -int -g_atoi(const char *str) -{ - if (str == 0) - { - return 0; - } - - return atoi(str); -} - -/*****************************************************************************/ -int -g_htoi(char *str) -{ - int len; - int index; - int rv; - int val; - int shift; - - rv = 0; - len = strlen(str); - index = len - 1; - shift = 0; - - while (index >= 0) - { - val = 0; - - switch (str[index]) - { - case '1': - val = 1; - break; - case '2': - val = 2; - break; - case '3': - val = 3; - break; - case '4': - val = 4; - break; - case '5': - val = 5; - break; - case '6': - val = 6; - break; - case '7': - val = 7; - break; - case '8': - val = 8; - break; - case '9': - val = 9; - break; - case 'a': - case 'A': - val = 10; - break; - case 'b': - case 'B': - val = 11; - break; - case 'c': - case 'C': - val = 12; - break; - case 'd': - case 'D': - val = 13; - break; - case 'e': - case 'E': - val = 14; - break; - case 'f': - case 'F': - val = 15; - break; - } - - rv = rv | (val << shift); - index--; - shift += 4; - } - - return rv; -} - -/*****************************************************************************/ -/* returns number of bytes copied into out_str */ -int -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 -g_pos(const char *str, const char *to_find) -{ - const char *pp; - - pp = strstr(str, to_find); - - if (pp == 0) - { - return -1; - } - - return (pp - str); -} - -/*****************************************************************************/ -int -g_mbstowcs(twchar *dest, const char *src, int n) -{ - wchar_t *ldest; - int rv; - - ldest = (wchar_t *)dest; - rv = mbstowcs(ldest, src, n); - return rv; -} - -/*****************************************************************************/ -int -g_wcstombs(char *dest, const twchar *src, int n) -{ - const wchar_t *lsrc; - int rv; - - lsrc = (const wchar_t *)src; - rv = wcstombs(dest, lsrc, n); - return rv; -} - -/*****************************************************************************/ -/* returns error */ -/* trim spaces and tabs, anything <= space */ -/* trim_flags 1 trim left, 2 trim right, 3 trim both, 4 trim through */ -/* this will always shorten the string or not change it */ -int -g_strtrim(char *str, int trim_flags) -{ - int index; - int len; - int text1_index; - int got_char; - wchar_t *text; - wchar_t *text1; - - len = mbstowcs(0, str, 0); - - if (len < 1) - { - return 0; - } - - if ((trim_flags < 1) || (trim_flags > 4)) - { - return 1; - } - - text = (wchar_t *)malloc(len * sizeof(wchar_t) + 8); - text1 = (wchar_t *)malloc(len * sizeof(wchar_t) + 8); - if (text == NULL || text1 == NULL) - { - free(text); - free(text1); - return 1; - } - text1_index = 0; - mbstowcs(text, str, len + 1); - - switch (trim_flags) - { - case 4: /* trim through */ - - for (index = 0; index < len; index++) - { - if (text[index] > 32) - { - text1[text1_index] = text[index]; - text1_index++; - } - } - - text1[text1_index] = 0; - break; - case 3: /* trim both */ - got_char = 0; - - for (index = 0; index < len; index++) - { - if (got_char) - { - text1[text1_index] = text[index]; - text1_index++; - } - else - { - if (text[index] > 32) - { - text1[text1_index] = text[index]; - text1_index++; - got_char = 1; - } - } - } - - text1[text1_index] = 0; - len = text1_index; - - /* trim right */ - for (index = len - 1; index >= 0; index--) - { - if (text1[index] > 32) - { - break; - } - } - - text1_index = index + 1; - text1[text1_index] = 0; - break; - case 2: /* trim right */ - - /* copy it */ - for (index = 0; index < len; index++) - { - text1[text1_index] = text[index]; - text1_index++; - } - - /* trim right */ - for (index = len - 1; index >= 0; index--) - { - if (text1[index] > 32) - { - break; - } - } - - text1_index = index + 1; - text1[text1_index] = 0; - break; - case 1: /* trim left */ - got_char = 0; - - for (index = 0; index < len; index++) - { - if (got_char) - { - text1[text1_index] = text[index]; - text1_index++; - } - else - { - if (text[index] > 32) - { - text1[text1_index] = text[index]; - text1_index++; - got_char = 1; - } - } - } - - text1[text1_index] = 0; - break; - } - - wcstombs(str, text1, text1_index + 1); - free(text); - free(text1); - return 0; -} - /*****************************************************************************/ long g_load_library(char *in) diff --git a/common/os_calls.h b/common/os_calls.h index d21248fa..99454044 100644 --- a/common/os_calls.h +++ b/common/os_calls.h @@ -119,27 +119,6 @@ int g_create_path(const char* path); int g_remove_dir(const char* dirname); int g_file_delete(const char* filename); int g_file_get_size(const char* filename); -int g_strlen(const char* text); -const char *g_strchr(const char *text, int c); -char* g_strcpy(char* dest, const char* src); -char* g_strncpy(char* dest, const char* src, int len); -char* g_strcat(char* dest, const char* src); -char* g_strncat(char* dest, const char* src, int len); -char* g_strdup(const char* in); -char* g_strndup(const char* in, const unsigned int maxlen); -int g_strcmp(const char* c1, const char* c2); -int g_strncmp(const char* c1, const char* c2, int len); -int g_strncmp_d(const char* c1, const char* c2, const char delim, int len); -int g_strcasecmp(const char* c1, const char* c2); -int g_strncasecmp(const char* c1, const char* c2, int len); -int g_atoi(const char* str); -int g_htoi(char* str); -int g_bytes_to_hexstr(const void *bytes, int num_bytes, char *out_str, - int bytes_out_str); -int g_pos(const char* str, const char* to_find); -int g_mbstowcs(twchar* dest, const char* src, int n); -int g_wcstombs(char* dest, const twchar* src, int n); -int g_strtrim(char* str, int trim_flags); long g_load_library(char* in); int g_free_library(long lib); void* g_get_proc_address(long lib, const char* name); diff --git a/common/ssl_calls.c b/common/ssl_calls.c index f86dc063..aee18c28 100644 --- a/common/ssl_calls.c +++ b/common/ssl_calls.c @@ -36,6 +36,7 @@ #include #include "os_calls.h" +#include "string_calls.h" #include "arch.h" #include "ssl_calls.h" #include "trans.h" diff --git a/common/string_calls.c b/common/string_calls.c index cb6468bc..6023347b 100644 --- a/common/string_calls.c +++ b/common/string_calls.c @@ -18,16 +18,20 @@ * generic string handling calls */ +#if defined(HAVE_CONFIG_H) +#include "config_ac.h" +#endif #include #include #include #include "string_calls.h" +#include "os_calls.h" unsigned int -g_format_info_string(char* dest, unsigned int len, - const char* format, - const struct info_string_tag map[]) +g_format_info_string(char *dest, unsigned int len, + const char *format, + const struct info_string_tag map[]) { unsigned int result = 0; const char *copy_from; /* Data to add to output */ @@ -40,26 +44,26 @@ g_format_info_string(char* dest, unsigned int len, { if (*format == '%') { - char ch= *(format + 1); - if (ch== '%') + char ch = *(format + 1); + if (ch == '%') { /* '%%' in format - replace with single '%' */ copy_from = format; - copy_len= 1; + copy_len = 1; skip = 2; } - else if (ch== '\0') + else if (ch == '\0') { /* Percent at end of string - ignore */ copy_from = NULL; - copy_len= 0; + copy_len = 0; skip = 1; } else { /* Look up the character in the map, assuming failure */ copy_from = NULL; - copy_len= 0; + copy_len = 0; skip = 2; for (m = map ; m->ch != '\0' ; ++m) @@ -125,12 +129,525 @@ g_bool2text(int value) int g_text2bool(const char *s) { - if ( (atoi(s) != 0) || - (0 == strcasecmp(s, "true")) || - (0 == strcasecmp(s, "on")) || - (0 == strcasecmp(s, "yes"))) + if ( (g_atoi(s) != 0) || + (0 == g_strcasecmp(s, "true")) || + (0 == g_strcasecmp(s, "on")) || + (0 == g_strcasecmp(s, "yes"))) { return 1; } return 0; } + +/*****************************************************************************/ +/* returns length of text */ +int +g_strlen(const char *text) +{ + if (text == NULL) + { + return 0; + } + + return strlen(text); +} + +/*****************************************************************************/ +/* locates char in text */ +const char * +g_strchr(const char *text, int c) +{ + if (text == NULL) + { + return 0; + } + + return strchr(text, c); +} + +/*****************************************************************************/ +/* returns dest */ +char * +g_strcpy(char *dest, const char *src) +{ + if (src == 0 && dest != 0) + { + dest[0] = 0; + return dest; + } + + if (dest == 0 || src == 0) + { + return 0; + } + + return strcpy(dest, src); +} + +/*****************************************************************************/ +/* returns dest */ +char * +g_strncpy(char *dest, const char *src, int len) +{ + char *rv; + + if (src == 0 && dest != 0) + { + dest[0] = 0; + return dest; + } + + if (dest == 0 || src == 0) + { + return 0; + } + + rv = strncpy(dest, src, len); + dest[len] = 0; + return rv; +} + +/*****************************************************************************/ +/* returns dest */ +char * +g_strcat(char *dest, const char *src) +{ + if (dest == 0 || src == 0) + { + return dest; + } + + return strcat(dest, src); +} + +/*****************************************************************************/ +/* returns dest */ +char * +g_strncat(char *dest, const char *src, int len) +{ + if (dest == 0 || src == 0) + { + return dest; + } + + return strncat(dest, src, len); +} + +/*****************************************************************************/ +/* if in = 0, return 0 else return newly alloced copy of in */ +char * +g_strdup(const char *in) +{ + int len; + char *p; + + if (in == 0) + { + return 0; + } + + len = g_strlen(in); + p = (char *)g_malloc(len + 1, 0); + + if (p != NULL) + { + g_strcpy(p, in); + } + + return p; +} + +/*****************************************************************************/ +/* if in = 0, return 0 else return newly alloced copy of input string + * if the input string is larger than maxlen the returned string will be + * truncated. All strings returned will include null termination*/ +char * +g_strndup(const char *in, const unsigned int maxlen) +{ + unsigned int len; + char *p; + + if (in == 0) + { + return 0; + } + + len = g_strlen(in); + + if (len > maxlen) + { + len = maxlen - 1; + } + + p = (char *)g_malloc(len + 2, 0); + + if (p != NULL) + { + g_strncpy(p, in, len + 1); + } + + return p; +} + +/*****************************************************************************/ +int +g_strcmp(const char *c1, const char *c2) +{ + return strcmp(c1, c2); +} + +/*****************************************************************************/ +int +g_strncmp(const char *c1, const char *c2, int len) +{ + return strncmp(c1, c2, len); +} + +/*****************************************************************************/ +/* compare up to delim */ +int +g_strncmp_d(const char *s1, const char *s2, const char delim, int n) +{ + char c1; + char c2; + + c1 = 0; + c2 = 0; + while (n > 0) + { + c1 = *(s1++); + c2 = *(s2++); + if ((c1 == 0) || (c1 != c2) || (c1 == delim) || (c2 == delim)) + { + return c1 - c2; + } + n--; + } + return c1 - c2; +} + +/*****************************************************************************/ +int +g_strcasecmp(const char *c1, const char *c2) +{ +#if defined(_WIN32) + return stricmp(c1, c2); +#else + return strcasecmp(c1, c2); +#endif +} + +/*****************************************************************************/ +int +g_strncasecmp(const char *c1, const char *c2, int len) +{ +#if defined(_WIN32) + return strnicmp(c1, c2, len); +#else + return strncasecmp(c1, c2, len); +#endif +} + +/*****************************************************************************/ +int +g_atoi(const char *str) +{ + if (str == 0) + { + return 0; + } + + return atoi(str); +} + +/*****************************************************************************/ +int +g_htoi(char *str) +{ + int len; + int index; + int rv; + int val; + int shift; + + rv = 0; + len = strlen(str); + index = len - 1; + shift = 0; + + while (index >= 0) + { + val = 0; + + switch (str[index]) + { + case '1': + val = 1; + break; + case '2': + val = 2; + break; + case '3': + val = 3; + break; + case '4': + val = 4; + break; + case '5': + val = 5; + break; + case '6': + val = 6; + break; + case '7': + val = 7; + break; + case '8': + val = 8; + break; + case '9': + val = 9; + break; + case 'a': + case 'A': + val = 10; + break; + case 'b': + case 'B': + val = 11; + break; + case 'c': + case 'C': + val = 12; + break; + case 'd': + case 'D': + val = 13; + break; + case 'e': + case 'E': + val = 14; + break; + case 'f': + case 'F': + val = 15; + break; + } + + rv = rv | (val << shift); + index--; + shift += 4; + } + + return rv; +} + +/*****************************************************************************/ +/* returns number of bytes copied into out_str */ +int +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 +g_pos(const char *str, const char *to_find) +{ + const char *pp; + + pp = strstr(str, to_find); + + if (pp == 0) + { + return -1; + } + + return (pp - str); +} + +/*****************************************************************************/ +int +g_mbstowcs(twchar *dest, const char *src, int n) +{ + wchar_t *ldest; + int rv; + + ldest = (wchar_t *)dest; + rv = mbstowcs(ldest, src, n); + return rv; +} + +/*****************************************************************************/ +int +g_wcstombs(char *dest, const twchar *src, int n) +{ + const wchar_t *lsrc; + int rv; + + lsrc = (const wchar_t *)src; + rv = wcstombs(dest, lsrc, n); + return rv; +} + +/*****************************************************************************/ +/* returns error */ +/* trim spaces and tabs, anything <= space */ +/* trim_flags 1 trim left, 2 trim right, 3 trim both, 4 trim through */ +/* this will always shorten the string or not change it */ +int +g_strtrim(char *str, int trim_flags) +{ + int index; + int len; + int text1_index; + int got_char; + wchar_t *text; + wchar_t *text1; + + len = mbstowcs(0, str, 0); + + if (len < 1) + { + return 0; + } + + if ((trim_flags < 1) || (trim_flags > 4)) + { + return 1; + } + + text = (wchar_t *)malloc(len * sizeof(wchar_t) + 8); + text1 = (wchar_t *)malloc(len * sizeof(wchar_t) + 8); + if (text == NULL || text1 == NULL) + { + free(text); + free(text1); + return 1; + } + text1_index = 0; + mbstowcs(text, str, len + 1); + + switch (trim_flags) + { + case 4: /* trim through */ + + for (index = 0; index < len; index++) + { + if (text[index] > 32) + { + text1[text1_index] = text[index]; + text1_index++; + } + } + + text1[text1_index] = 0; + break; + case 3: /* trim both */ + got_char = 0; + + for (index = 0; index < len; index++) + { + if (got_char) + { + text1[text1_index] = text[index]; + text1_index++; + } + else + { + if (text[index] > 32) + { + text1[text1_index] = text[index]; + text1_index++; + got_char = 1; + } + } + } + + text1[text1_index] = 0; + len = text1_index; + + /* trim right */ + for (index = len - 1; index >= 0; index--) + { + if (text1[index] > 32) + { + break; + } + } + + text1_index = index + 1; + text1[text1_index] = 0; + break; + case 2: /* trim right */ + + /* copy it */ + for (index = 0; index < len; index++) + { + text1[text1_index] = text[index]; + text1_index++; + } + + /* trim right */ + for (index = len - 1; index >= 0; index--) + { + if (text1[index] > 32) + { + break; + } + } + + text1_index = index + 1; + text1[text1_index] = 0; + break; + case 1: /* trim left */ + got_char = 0; + + for (index = 0; index < len; index++) + { + if (got_char) + { + text1[text1_index] = text[index]; + text1_index++; + } + else + { + if (text[index] > 32) + { + text1[text1_index] = text[index]; + text1_index++; + got_char = 1; + } + } + } + + text1[text1_index] = 0; + break; + } + + wcstombs(str, text1, text1_index + 1); + free(text); + free(text1); + return 0; +} + diff --git a/common/string_calls.h b/common/string_calls.h index 32aa62fd..cce332ac 100644 --- a/common/string_calls.h +++ b/common/string_calls.h @@ -21,6 +21,8 @@ #if !defined(STRING_CALLS_H) #define STRING_CALLS_H +#include "arch.h" + /** * Map a character to a string value * @@ -55,9 +57,9 @@ struct info_string_tag * the buffer length (as in snprintf()) */ unsigned int -g_format_info_string(char* dest, unsigned int len, - const char* format, - const struct info_string_tag map[]); +g_format_info_string(char *dest, unsigned int len, + const char *format, + const struct info_string_tag map[]); /** @@ -78,4 +80,25 @@ g_bool2text(int value); int g_text2bool(const char *s); +int g_strlen(const char *text); +const char *g_strchr(const char *text, int c); +char *g_strcpy(char *dest, const char *src); +char *g_strncpy(char *dest, const char *src, int len); +char *g_strcat(char *dest, const char *src); +char *g_strncat(char *dest, const char *src, int len); +char *g_strdup(const char *in); +char *g_strndup(const char *in, const unsigned int maxlen); +int g_strcmp(const char *c1, const char *c2); +int g_strncmp(const char *c1, const char *c2, int len); +int g_strncmp_d(const char *c1, const char *c2, const char delim, int len); +int g_strcasecmp(const char *c1, const char *c2); +int g_strncasecmp(const char *c1, const char *c2, int len); +int g_atoi(const char *str); +int g_htoi(char *str); +int g_bytes_to_hexstr(const void *bytes, int num_bytes, char *out_str, + int bytes_out_str); +int g_pos(const char *str, const char *to_find); +int g_mbstowcs(twchar *dest, const char *src, int n); +int g_wcstombs(char *dest, const twchar *src, int n); +int g_strtrim(char *str, int trim_flags); #endif diff --git a/common/trans.c b/common/trans.c index 6a0be5d4..c8820a54 100644 --- a/common/trans.c +++ b/common/trans.c @@ -23,6 +23,7 @@ #endif #include "os_calls.h" +#include "string_calls.h" #include "trans.h" #include "arch.h" #include "parse.h" diff --git a/keygen/keygen.c b/keygen/keygen.c index 74be4d6e..e1c1e95c 100644 --- a/keygen/keygen.c +++ b/keygen/keygen.c @@ -30,6 +30,7 @@ #endif #include "os_calls.h" +#include "string_calls.h" #include "ssl_calls.h" #include "arch.h" #include "list.h" diff --git a/libxrdp/libxrdp.c b/libxrdp/libxrdp.c index fd3615b0..14edb29e 100644 --- a/libxrdp/libxrdp.c +++ b/libxrdp/libxrdp.c @@ -23,6 +23,7 @@ #endif #include "libxrdp.h" +#include "string_calls.h" #include "xrdp_orders_rail.h" #include "ms-rdpbcgr.h" diff --git a/libxrdp/xrdp_channel.c b/libxrdp/xrdp_channel.c index 125ac085..8e8a25ed 100644 --- a/libxrdp/xrdp_channel.c +++ b/libxrdp/xrdp_channel.c @@ -23,6 +23,7 @@ #endif #include "libxrdp.h" +#include "string_calls.h" /* todo, move these to constants.h */ //#define CHANNEL_CHUNK_LENGTH 1600 /* todo, why is this so small? */ diff --git a/libxrdp/xrdp_orders_rail.c b/libxrdp/xrdp_orders_rail.c index 26dab686..735b92e1 100644 --- a/libxrdp/xrdp_orders_rail.c +++ b/libxrdp/xrdp_orders_rail.c @@ -23,6 +23,7 @@ #include "libxrdp.h" #include "ms-rdpegdi.h" #include "xrdp_rail.h" +#include "string_calls.h" /* [MS-RDPERP]: Remote Desktop Protocol: Remote Programs Virtual Channel Extension diff --git a/libxrdp/xrdp_sec.c b/libxrdp/xrdp_sec.c index 7317c639..f912ac1d 100644 --- a/libxrdp/xrdp_sec.c +++ b/libxrdp/xrdp_sec.c @@ -25,6 +25,7 @@ #include "libxrdp.h" #include "ms-rdpbcgr.h" #include "log.h" +#include "string_calls.h" #define LOG_LEVEL 1 #define LLOG(_level, _args) \ diff --git a/sesman/access.c b/sesman/access.c index b54378b9..4b8489aa 100644 --- a/sesman/access.c +++ b/sesman/access.c @@ -29,6 +29,7 @@ #endif #include "sesman.h" +#include "string_calls.h" extern struct config_sesman *g_cfg; /* in sesman.c */ diff --git a/sesman/chansrv/chansrv.c b/sesman/chansrv/chansrv.c index abd66f77..4bca525e 100644 --- a/sesman/chansrv/chansrv.c +++ b/sesman/chansrv/chansrv.c @@ -23,6 +23,7 @@ #include "arch.h" #include "os_calls.h" +#include "string_calls.h" #include "thread_calls.h" #include "trans.h" #include "chansrv.h" diff --git a/sesman/chansrv/clipboard.c b/sesman/chansrv/clipboard.c index e617f966..04382092 100644 --- a/sesman/chansrv/clipboard.c +++ b/sesman/chansrv/clipboard.c @@ -169,6 +169,7 @@ x-special/gnome-copied-files #include "arch.h" #include "parse.h" #include "os_calls.h" +#include "string_calls.h" #include "chansrv.h" #include "chansrv_config.h" #include "clipboard.h" diff --git a/sesman/chansrv/clipboard_file.c b/sesman/chansrv/clipboard_file.c index 29f16b03..13a4c7c4 100644 --- a/sesman/chansrv/clipboard_file.c +++ b/sesman/chansrv/clipboard_file.c @@ -33,6 +33,7 @@ #include "arch.h" #include "parse.h" #include "os_calls.h" +#include "string_calls.h" #include "list.h" #include "chansrv.h" #include "clipboard.h" diff --git a/sesman/chansrv/devredir.c b/sesman/chansrv/devredir.c index 4b56d534..1dbf3975 100644 --- a/sesman/chansrv/devredir.c +++ b/sesman/chansrv/devredir.c @@ -49,6 +49,7 @@ #include "arch.h" #include "parse.h" #include "os_calls.h" +#include "string_calls.h" #include "log.h" #include "chansrv.h" #include "chansrv_fuse.h" diff --git a/sesman/chansrv/irp.c b/sesman/chansrv/irp.c index 989d8a96..a1bf9a4d 100644 --- a/sesman/chansrv/irp.c +++ b/sesman/chansrv/irp.c @@ -28,6 +28,7 @@ #include "chansrv.h" #include "parse.h" #include "os_calls.h" +#include "string_calls.h" #include "irp.h" IRP *g_irp_head = NULL; diff --git a/sesman/chansrv/rail.c b/sesman/chansrv/rail.c index 341d492b..ad074dab 100644 --- a/sesman/chansrv/rail.c +++ b/sesman/chansrv/rail.c @@ -39,6 +39,7 @@ #include "xcommon.h" #include "log.h" #include "os_calls.h" +#include "string_calls.h" #include "thread_calls.h" #include "list.h" diff --git a/sesman/chansrv/smartcard.c b/sesman/chansrv/smartcard.c index 061f407f..69e639e9 100644 --- a/sesman/chansrv/smartcard.c +++ b/sesman/chansrv/smartcard.c @@ -28,6 +28,7 @@ #include #include "os_calls.h" +#include "string_calls.h" #include "smartcard.h" #include "log.h" #include "irp.h" diff --git a/sesman/chansrv/smartcard_pcsc.c b/sesman/chansrv/smartcard_pcsc.c index 2ec14f05..7eb20712 100644 --- a/sesman/chansrv/smartcard_pcsc.c +++ b/sesman/chansrv/smartcard_pcsc.c @@ -33,6 +33,7 @@ #define PCSC_STANDIN 1 #include "os_calls.h" +#include "string_calls.h" #include "smartcard.h" #include "log.h" #include "irp.h" diff --git a/sesman/env.c b/sesman/env.c index 4b786f22..6cb711c0 100644 --- a/sesman/env.c +++ b/sesman/env.c @@ -34,6 +34,7 @@ #include "list.h" #include "sesman.h" #include "ssl_calls.h" +#include "string_calls.h" extern unsigned char g_fixedkey[8]; /* in sesman.c */ extern struct config_sesman *g_cfg; /* in sesman.c */ diff --git a/sesman/libscp/libscp_session.c b/sesman/libscp/libscp_session.c index ddb2eb3e..99629f31 100644 --- a/sesman/libscp/libscp_session.c +++ b/sesman/libscp/libscp_session.c @@ -29,6 +29,7 @@ #endif #include "libscp_session.h" +#include "string_calls.h" #include #include diff --git a/sesman/libscp/libscp_v0.c b/sesman/libscp/libscp_v0.c index e1327ad2..7b9ce548 100644 --- a/sesman/libscp/libscp_v0.c +++ b/sesman/libscp/libscp_v0.c @@ -31,6 +31,7 @@ #include "libscp_v0.h" #include "os_calls.h" +#include "string_calls.h" extern struct log_config *s_log; diff --git a/sesman/libscp/libscp_v1c.c b/sesman/libscp/libscp_v1c.c index 93239176..95d21382 100644 --- a/sesman/libscp/libscp_v1c.c +++ b/sesman/libscp/libscp_v1c.c @@ -29,6 +29,7 @@ #endif #include "libscp_v1c.h" +#include "string_calls.h" #include #include diff --git a/sesman/libscp/libscp_v1c_mng.c b/sesman/libscp/libscp_v1c_mng.c index 368f249a..d528d37a 100644 --- a/sesman/libscp/libscp_v1c_mng.c +++ b/sesman/libscp/libscp_v1c_mng.c @@ -29,6 +29,7 @@ #endif #include "libscp_v1c_mng.h" +#include "string_calls.h" #include #include diff --git a/sesman/libscp/libscp_v1s.c b/sesman/libscp/libscp_v1s.c index 2465a0f2..e2cf558b 100644 --- a/sesman/libscp/libscp_v1s.c +++ b/sesman/libscp/libscp_v1s.c @@ -32,6 +32,7 @@ #define LIBSCP_V1S_C #include "libscp_v1s.h" +#include "string_calls.h" //extern struct log_config* s_log; diff --git a/sesman/libscp/libscp_v1s_mng.c b/sesman/libscp/libscp_v1s_mng.c index df104bba..7f6e3576 100644 --- a/sesman/libscp/libscp_v1s_mng.c +++ b/sesman/libscp/libscp_v1s_mng.c @@ -32,6 +32,7 @@ #define LIBSCP_V1S_MNG_C #include "libscp_v1s_mng.h" +#include "string_calls.h" //extern struct log_config* s_log; diff --git a/sesman/sesman.c b/sesman/sesman.c index 6713de67..88ed884f 100644 --- a/sesman/sesman.c +++ b/sesman/sesman.c @@ -32,6 +32,7 @@ #include "sesman.h" #include "xrdp_configure_options.h" +#include "string_calls.h" struct sesman_startup_params { diff --git a/sesman/session.c b/sesman/session.c index f2a54c19..6ea772e2 100644 --- a/sesman/session.c +++ b/sesman/session.c @@ -41,6 +41,7 @@ #include "libscp_types.h" #include "xauth.h" #include "xrdp_sockets.h" +#include "string_calls.h" #ifndef PR_SET_NO_NEW_PRIVS #define PR_SET_NO_NEW_PRIVS 38 diff --git a/sesman/tools/sesadmin.c b/sesman/tools/sesadmin.c index bd5144a3..b8949301 100644 --- a/sesman/tools/sesadmin.c +++ b/sesman/tools/sesadmin.c @@ -27,6 +27,7 @@ #include "parse.h" #include "log.h" #include "libscp.h" +#include "string_calls.h" #include #include diff --git a/sesman/tools/sesrun.c b/sesman/tools/sesrun.c index 59f3e42a..3b8ca595 100644 --- a/sesman/tools/sesrun.c +++ b/sesman/tools/sesrun.c @@ -37,6 +37,7 @@ #include "config.h" #include "log.h" #include "tcp.h" +#include "string_calls.h" #if !defined(PACKAGE_VERSION) #define PACKAGE_VERSION "???" diff --git a/sesman/tools/sestest.c b/sesman/tools/sestest.c index d67b1a49..9d9d45af 100644 --- a/sesman/tools/sestest.c +++ b/sesman/tools/sestest.c @@ -26,6 +26,7 @@ #include "libscp.h" #include "parse.h" #include "log.h" +#include "string_calls.h" #include diff --git a/sesman/verify_user_pam.c b/sesman/verify_user_pam.c index 2ded2660..3fbb9279 100644 --- a/sesman/verify_user_pam.c +++ b/sesman/verify_user_pam.c @@ -30,6 +30,7 @@ #include "arch.h" #include "os_calls.h" +#include "string_calls.h" #include #include diff --git a/sesman/xauth.c b/sesman/xauth.c index 8dcff3d9..a7e788bf 100644 --- a/sesman/xauth.c +++ b/sesman/xauth.c @@ -30,6 +30,7 @@ #include #include "log.h" #include "os_calls.h" +#include "string_calls.h" /******************************************************************************/ diff --git a/vnc/vnc.c b/vnc/vnc.c index 42e7f4c1..68532e91 100644 --- a/vnc/vnc.c +++ b/vnc/vnc.c @@ -34,6 +34,7 @@ #include "log.h" #include "trans.h" #include "ssl_calls.h" +#include "string_calls.h" #include "xrdp_client_info.h" #define LLOG_LEVEL 1 diff --git a/xrdp/funcs.c b/xrdp/funcs.c index d22927ac..02b10e84 100644 --- a/xrdp/funcs.c +++ b/xrdp/funcs.c @@ -23,6 +23,7 @@ #endif #include "xrdp.h" +#include "string_calls.h" /*****************************************************************************/ /* returns boolean */ diff --git a/xrdp/lang.c b/xrdp/lang.c index 723883a1..bed1edbb 100644 --- a/xrdp/lang.c +++ b/xrdp/lang.c @@ -26,6 +26,7 @@ #include "xrdp.h" #include "ms-rdpbcgr.h" #include "log.h" +#include "string_calls.h" /* map for rdp to x11 scancodes code1 is regular scancode, code2 is extended scancode */ diff --git a/xrdp/xrdp.c b/xrdp/xrdp.c index 3460f313..d9eb30bc 100644 --- a/xrdp/xrdp.c +++ b/xrdp/xrdp.c @@ -27,6 +27,7 @@ #include "xrdp.h" #include "log.h" #include "xrdp_configure_options.h" +#include "string_calls.h" #if !defined(PACKAGE_VERSION) #define PACKAGE_VERSION "???" diff --git a/xrdp/xrdp_bitmap.c b/xrdp/xrdp_bitmap.c index 627f73c7..109b1e50 100644 --- a/xrdp/xrdp_bitmap.c +++ b/xrdp/xrdp_bitmap.c @@ -29,6 +29,7 @@ #include "xrdp.h" #include "log.h" +#include "string_calls.h" #define LLOG_LEVEL 1 #define LLOGLN(_level, _args) \ diff --git a/xrdp/xrdp_painter.c b/xrdp/xrdp_painter.c index 97ae5cc3..6a37c214 100644 --- a/xrdp/xrdp_painter.c +++ b/xrdp/xrdp_painter.c @@ -23,6 +23,7 @@ #endif #include "xrdp.h" +#include "string_calls.h" #if defined(XRDP_PAINTER) #include /* libpainter */ diff --git a/xup/xup.c b/xup/xup.c index 81d4c732..2f257508 100644 --- a/xup/xup.c +++ b/xup/xup.c @@ -25,6 +25,7 @@ #include "xup.h" #include "log.h" #include "trans.h" +#include "string_calls.h" #define LOG_LEVEL 1 #define LLOG(_level, _args) \