fixed a silly off by 1 bug
authorAndrew Tridgell <tridge@samba.org>
Mon, 24 Sep 2001 06:24:14 +0000 (06:24 +0000)
committerAndrew Tridgell <tridge@samba.org>
Mon, 24 Sep 2001 06:24:14 +0000 (06:24 +0000)
(This used to be commit e558ab6ac8930e3393291fe12289ad43175b8a1d)

source3/lib/charcnv.c
source3/web/cgi.c

index ebcceef81613e8eb24ab842e449554b0dc18775f..0e7d5241f4a1cd678c045a633cfa06ae0c636cac 100644 (file)
@@ -99,6 +99,9 @@ size_t convert_string(charset_t from, charset_t to,
        static int initialised;
        smb_iconv_t descriptor;
 
+       if (srclen == -1) srclen = strlen(src)+1;
+       if (destlen == -1) destlen = strlen(dest)+1;
+
        if (!initialised) {
                initialised = 1;
                init_iconv();
index 7b12bf574895f739cc9240fd124ded34482fbb40..939b8f94cdc8f2d69f91eb946e0c5b77602934ce 100644 (file)
@@ -221,13 +221,13 @@ void cgi_load_variables(void)
                pstring dest;
 
                convert_string(CH_DISPLAY, CH_UNIX, 
-                              variables[i].name, strlen(variables[i].name)
+                              variables[i].name, -1
                               dest, sizeof(dest));
                free(variables[i].name);
                variables[i].name = strdup(dest);
 
                convert_string(CH_DISPLAY, CH_UNIX, 
-                              variables[i].value, strlen(variables[i].name), 
+                              variables[i].value, -1,
                               dest, sizeof(dest));
                free(variables[i].value);
                variables[i].value = strdup(dest);