diff options
Diffstat (limited to 'source/rpc_server/srv_spoolss_nt.c')
-rw-r--r-- | source/rpc_server/srv_spoolss_nt.c | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/source/rpc_server/srv_spoolss_nt.c b/source/rpc_server/srv_spoolss_nt.c index 1d7904f1afc..805f3e4856c 100644 --- a/source/rpc_server/srv_spoolss_nt.c +++ b/source/rpc_server/srv_spoolss_nt.c @@ -1542,7 +1542,7 @@ WERROR _spoolss_open_printer_ex( pipes_struct *p, SPOOL_Q_OPEN_PRINTER_EX *q_u, /* some sanity check because you can open a printer or a print server */ /* aka: \\server\printer or \\server */ - unistr2_to_ascii(name, q_u->printername, sizeof(name)-1); + unistr2_to_ascii(name, q_u->printername, sizeof(name)); DEBUGADD(3,("checking name: %s\n",name)); @@ -1990,8 +1990,8 @@ WERROR _spoolss_deleteprinterdriver(pipes_struct *p, SPOOL_Q_DELETEPRINTERDRIVER return WERR_ACCESS_DENIED; } - unistr2_to_ascii(driver, &q_u->driver, sizeof(driver)-1 ); - unistr2_to_ascii(arch, &q_u->arch, sizeof(arch)-1 ); + unistr2_to_ascii(driver, &q_u->driver, sizeof(driver)); + unistr2_to_ascii(arch, &q_u->arch, sizeof(arch)); /* check that we have a valid driver name first */ @@ -2085,8 +2085,8 @@ WERROR _spoolss_deleteprinterdriverex(pipes_struct *p, SPOOL_Q_DELETEPRINTERDRIV return WERR_ACCESS_DENIED; } - unistr2_to_ascii(driver, &q_u->driver, sizeof(driver)-1 ); - unistr2_to_ascii(arch, &q_u->arch, sizeof(arch)-1 ); + unistr2_to_ascii(driver, &q_u->driver, sizeof(driver)); + unistr2_to_ascii(arch, &q_u->arch, sizeof(arch)); /* check that we have a valid driver name first */ if ((version=get_version_id(arch)) == -1) { @@ -2463,7 +2463,7 @@ WERROR _spoolss_getprinterdata(pipes_struct *p, SPOOL_Q_GETPRINTERDATA *q_u, SPO goto done; } - unistr2_to_ascii(value, valuename, sizeof(value)-1); + unistr2_to_ascii(value, valuename, sizeof(value)); if ( Printer->printer_type == SPLHND_SERVER ) status = getprinterdata_printer_server( p->mem_ctx, value, type, data, needed, *out_size ); @@ -2681,7 +2681,7 @@ WERROR _spoolss_rffpcnex(pipes_struct *p, SPOOL_Q_RFFPCNEX *q_u, SPOOL_R_RFFPCNE Printer->notify.option=dup_spool_notify_option(option); unistr2_to_ascii(Printer->notify.localmachine, localmachine, - sizeof(Printer->notify.localmachine)-1); + sizeof(Printer->notify.localmachine)); /* Connect to the client machine and send a ReplyOpenPrinter */ @@ -4748,7 +4748,7 @@ WERROR _spoolss_enumprinters( pipes_struct *p, SPOOL_Q_ENUMPRINTERS *q_u, SPOOL_ * Level 5: same as Level 2 */ - unistr2_to_ascii(name, servername, sizeof(name)-1); + unistr2_to_ascii(name, servername, sizeof(name)); strupper_m(name); switch (level) { @@ -5701,7 +5701,7 @@ WERROR _spoolss_getprinterdriver2(pipes_struct *p, SPOOL_Q_GETPRINTERDRIVER2 *q_ *serverminorversion = 0; fstrcpy(servername, get_server_name( printer )); - unistr2_to_ascii(architecture, uni_arch, sizeof(architecture)-1); + unistr2_to_ascii(architecture, uni_arch, sizeof(architecture)); if (!get_printer_snum(p, handle, &snum, NULL)) return WERR_BADFID; @@ -7128,8 +7128,8 @@ WERROR _spoolss_enumprinterdrivers( pipes_struct *p, SPOOL_Q_ENUMPRINTERDRIVERS *needed = 0; *returned = 0; - unistr2_to_ascii(architecture, &q_u->environment, sizeof(architecture)-1); - unistr2_to_ascii(servername, &q_u->name, sizeof(servername)-1); + unistr2_to_ascii(architecture, &q_u->environment, sizeof(architecture)); + unistr2_to_ascii(servername, &q_u->name, sizeof(servername)); if ( !is_myname_or_ipaddr( servername ) ) return WERR_UNKNOWN_PRINTER_DRIVER; @@ -7301,7 +7301,7 @@ WERROR _spoolss_getform(pipes_struct *p, SPOOL_Q_GETFORM *q_u, SPOOL_R_GETFORM * rpcbuf_move(q_u->buffer, &r_u->buffer); buffer = r_u->buffer; - unistr2_to_ascii(form_name, uni_formname, sizeof(form_name)-1); + unistr2_to_ascii(form_name, uni_formname, sizeof(form_name)); DEBUG(4,("_spoolss_getform\n")); DEBUGADD(5,("Offered buffer size [%d]\n", offered)); @@ -7917,8 +7917,8 @@ static WERROR getprinterdriverdir_level_1(UNISTR2 *name, UNISTR2 *uni_environmen DRIVER_DIRECTORY_1 *info=NULL; WERROR result = WERR_OK; - unistr2_to_ascii(servername, name, sizeof(servername)-1); - unistr2_to_ascii(long_archi, uni_environment, sizeof(long_archi)-1); + unistr2_to_ascii(servername, name, sizeof(servername)); + unistr2_to_ascii(long_archi, uni_environment, sizeof(long_archi)); /* check for beginning double '\'s and that the server long enough */ @@ -8235,7 +8235,7 @@ WERROR _spoolss_setprinterdata( pipes_struct *p, SPOOL_Q_SETPRINTERDATA *q_u, SP if (!W_ERROR_IS_OK(status)) return status; - unistr2_to_ascii( valuename, value, sizeof(valuename)-1 ); + unistr2_to_ascii(valuename, value, sizeof(valuename)); /* * When client side code sets a magic printer data key, detect it and save @@ -8327,7 +8327,7 @@ WERROR _spoolss_deleteprinterdata(pipes_struct *p, SPOOL_Q_DELETEPRINTERDATA *q_ if (!W_ERROR_IS_OK(status)) return status; - unistr2_to_ascii( valuename, value, sizeof(valuename)-1 ); + unistr2_to_ascii(valuename, value, sizeof(valuename)); status = delete_printer_dataex( printer, SPOOL_PRINTERDATA_KEY, valuename ); @@ -9049,8 +9049,8 @@ WERROR _spoolss_getprinterdataex(pipes_struct *p, SPOOL_Q_GETPRINTERDATAEX *q_u, DEBUG(4,("_spoolss_getprinterdataex\n")); - unistr2_to_ascii(keyname, &q_u->keyname, sizeof(keyname) - 1); - unistr2_to_ascii(valuename, &q_u->valuename, sizeof(valuename) - 1); + unistr2_to_ascii(keyname, &q_u->keyname, sizeof(keyname)); + unistr2_to_ascii(valuename, &q_u->valuename, sizeof(valuename)); DEBUG(10, ("_spoolss_getprinterdataex: key => [%s], value => [%s]\n", keyname, valuename)); @@ -9181,8 +9181,8 @@ WERROR _spoolss_setprinterdataex(pipes_struct *p, SPOOL_Q_SETPRINTERDATAEX *q_u, if (!W_ERROR_IS_OK(status)) return status; - unistr2_to_ascii( valuename, &q_u->value, sizeof(valuename) - 1); - unistr2_to_ascii( keyname, &q_u->key, sizeof(keyname) - 1); + unistr2_to_ascii( valuename, &q_u->value, sizeof(valuename)); + unistr2_to_ascii( keyname, &q_u->key, sizeof(keyname)); /* check for OID in valuename */ @@ -9259,8 +9259,8 @@ WERROR _spoolss_deleteprinterdataex(pipes_struct *p, SPOOL_Q_DELETEPRINTERDATAEX if (!W_ERROR_IS_OK(status)) return status; - unistr2_to_ascii( valuename, value, sizeof(valuename)-1 ); - unistr2_to_ascii( keyname, key, sizeof(keyname)-1 ); + unistr2_to_ascii(valuename, value, sizeof(valuename)); + unistr2_to_ascii(keyname, key, sizeof(keyname)); status = delete_printer_dataex( printer, keyname, valuename ); @@ -9308,7 +9308,7 @@ WERROR _spoolss_enumprinterkey(pipes_struct *p, SPOOL_Q_ENUMPRINTERKEY *q_u, SPO /* get the list of subkey names */ - unistr2_to_ascii( key, &q_u->key, sizeof(key)-1 ); + unistr2_to_ascii(key, &q_u->key, sizeof(key)); data = printer->info_2->data; num_keys = get_printer_subkeys( data, key, &keynames ); @@ -9383,7 +9383,7 @@ WERROR _spoolss_deleteprinterkey(pipes_struct *p, SPOOL_Q_DELETEPRINTERKEY *q_u, /* delete the key and all subneys */ - unistr2_to_ascii(key, &q_u->keyname, sizeof(key) - 1); + unistr2_to_ascii(key, &q_u->keyname, sizeof(key)); status = delete_all_printer_data( printer->info_2, key ); @@ -9434,7 +9434,7 @@ WERROR _spoolss_enumprinterdataex(pipes_struct *p, SPOOL_Q_ENUMPRINTERDATAEX *q_ * --jerry */ - unistr2_to_ascii(key, &q_u->key, sizeof(key) - 1); + unistr2_to_ascii(key, &q_u->key, sizeof(key)); if ( !strlen(key) ) { result = WERR_INVALID_PARAM; goto done; @@ -9454,7 +9454,7 @@ WERROR _spoolss_enumprinterdataex(pipes_struct *p, SPOOL_Q_ENUMPRINTERDATAEX *q_ p_data = printer->info_2->data; - unistr2_to_ascii(key, &q_u->key, sizeof(key) - 1); + unistr2_to_ascii(key, &q_u->key, sizeof(key)); if ( (key_index = lookup_printerkey( p_data, key)) == -1 ) { DEBUG(10,("_spoolss_enumprinterdataex: Unknown keyname [%s]\n", key)); @@ -9571,7 +9571,7 @@ static WERROR getprintprocessordirectory_level_1(UNISTR2 *name, PRINTPROCESSOR_DIRECTORY_1 *info=NULL; WERROR result = WERR_OK; - unistr2_to_ascii(long_archi, environment, sizeof(long_archi)-1); + unistr2_to_ascii(long_archi, environment, sizeof(long_archi)); if (!get_short_archi(long_archi)) return WERR_INVALID_ENVIRONMENT; |