s3-spoolss: remove unused init_unistr_array().
authorGünther Deschner <gd@samba.org>
Mon, 16 Mar 2009 23:28:49 +0000 (00:28 +0100)
committerGünther Deschner <gd@samba.org>
Tue, 17 Mar 2009 11:21:31 +0000 (12:21 +0100)
Guenther

source3/rpc_server/srv_spoolss_nt.c

index d457180626575bceba4fbcafcf1d8bb283e1cf3e..0a0c11db624a5b516634b1eaeac65e9f4cb003e5 100644 (file)
@@ -5158,79 +5158,6 @@ static WERROR construct_printer_driver_info_2(TALLOC_CTX *mem_ctx,
        return result;
 }
 
-/********************************************************************
- * copy a strings array and convert to UNICODE
- *
- * convert an array of ascii string to a UNICODE string
- ********************************************************************/
-
-static uint32 init_unistr_array(uint16 **uni_array, fstring *char_array, const char *servername)
-{
-       int i=0;
-       int j=0;
-       const char *v;
-       char *line = NULL;
-       TALLOC_CTX *ctx = talloc_tos();
-
-       DEBUG(6,("init_unistr_array\n"));
-       *uni_array=NULL;
-
-       while (true) {
-               if ( !char_array ) {
-                       v = "";
-               } else {
-                       v = char_array[i];
-                       if (!v)
-                               v = ""; /* hack to handle null lists */
-               }
-
-               /* hack to allow this to be used in places other than when generating
-                  the list of dependent files */
-
-               TALLOC_FREE(line);
-               if ( servername ) {
-                       line = talloc_asprintf(ctx,
-                                       "\\\\%s%s",
-                                       canon_servername(servername),
-                                       v);
-               } else {
-                       line = talloc_strdup(ctx, v);
-               }
-
-               if (!line) {
-                       SAFE_FREE(*uni_array);
-                       return 0;
-               }
-               DEBUGADD(6,("%d:%s:%lu\n", i, line, (unsigned long)strlen(line)));
-
-               /* add one extra unit16 for the second terminating NULL */
-
-               if ( (*uni_array=SMB_REALLOC_ARRAY(*uni_array, uint16, j+1+strlen(line)+2)) == NULL ) {
-                       DEBUG(2,("init_unistr_array: Realloc error\n" ));
-                       return 0;
-               }
-
-               if ( !strlen(v) )
-                       break;
-
-               j += (rpcstr_push((*uni_array+j), line, sizeof(uint16)*strlen(line)+2, STR_TERMINATE) / sizeof(uint16));
-               i++;
-       }
-
-       if (*uni_array) {
-               /* special case for ""; we need to add both NULL's here */
-               if (!j)
-                       (*uni_array)[j++]=0x0000;
-               (*uni_array)[j]=0x0000;
-       }
-
-       DEBUGADD(6,("last one:done\n"));
-
-       /* return size of array in uint16's */
-
-       return j+1;
-}
-
 /********************************************************************
  * construct_printer_info_3
  * fill a printer_info_3 struct