From f0c7bdb304846829259edaab25454f81ab5a4c36 Mon Sep 17 00:00:00 2001 From: jsorg71 Date: Fri, 21 Jan 2005 03:55:16 +0000 Subject: added pointer cache, some debug messages and some other fixes --- xrdp/funcs.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'xrdp/funcs.c') diff --git a/xrdp/funcs.c b/xrdp/funcs.c index 35c95445..4c3ac42b 100644 --- a/xrdp/funcs.c +++ b/xrdp/funcs.c @@ -285,7 +285,9 @@ int add_char_at(char* text, char ch, int index) return 0; } for (i = len - 1; i >= index; i--) + { text[i + 1] = text[i]; + } text[i + 1] = ch; text[len + 1] = 0; return 0; @@ -301,14 +303,18 @@ int remove_char_at(char* text, int index) len = g_strlen(text); if (len <= 0) + { return 0; + } if (index >= len - 1 || index < 0) { text[len - 1] = 0; return 0; } for (i = index; i < len - 1; i++) + { text[i] = text[i + 1]; + } text[len - 1] = 0; return 0; } @@ -317,7 +323,9 @@ int remove_char_at(char* text, int index) int set_string(char** in_str, char* in) { if (in_str == 0) + { return 0; + } g_free(*in_str); *in_str = g_strdup(in); return 0; -- cgit v1.2.1