Use tparam not tdata when reallocing params to make clearer.
authorJeremy Allison <jra@samba.org>
Fri, 17 Aug 2001 18:16:42 +0000 (18:16 +0000)
committerJeremy Allison <jra@samba.org>
Fri, 17 Aug 2001 18:16:42 +0000 (18:16 +0000)
Jeremy.
(This used to be commit 31804cb7a89f280cec4c047cad643c7f593f9b03)

source3/libsmb/clitrans.c

index c97ddfc33188499f45c8ca77d92543994fb9dee3..83912ddc6da5a803b5d5c499f5d5ecc948616178 100644 (file)
@@ -148,6 +148,7 @@ BOOL cli_receive_trans(struct cli_state *cli,int trans,
        uint8 eclass;
        uint32 ecode;
        char *tdata;
+       char *tparam;
 
        *data_len = *param_len = 0;
 
@@ -170,14 +171,13 @@ BOOL cli_receive_trans(struct cli_state *cli,int trans,
         * be treated as such.
         */
 
-       if (cli_is_dos_error(cli))
-       {
-                cli_dos_error(cli, &eclass, &ecode);
+       if (cli_is_dos_error(cli)) {
+               cli_dos_error(cli, &eclass, &ecode);
 
-                if(cli->nt_pipe_fnum == 0)
+               if(cli->nt_pipe_fnum == 0)
                        return(False);
 
-                if(!(eclass == ERRDOS && ecode == ERRmoredata)) {
+               if(!(eclass == ERRDOS && ecode == ERRmoredata)) {
                        if (eclass != 0 && (ecode != (0x80000000 | STATUS_BUFFER_OVERFLOW)))
                                return(False);
                }
@@ -199,13 +199,13 @@ BOOL cli_receive_trans(struct cli_state *cli,int trans,
        }
 
        if (total_param!=0) {
-               tdata = Realloc(*param,total_param);
-               if (!tdata && total_param!=0) {
+               tparam = Realloc(*param,total_param);
+               if (!tparam) {
                        DEBUG(0,("cli_receive_trans: failed to enlarge param buffer\n"));
                        return False;
                }
                else
-                       *param = tdata;
+                       *param = tparam;
        }
 
        while (1)  {
@@ -377,6 +377,7 @@ BOOL cli_receive_nt_trans(struct cli_state *cli,
        uint8 eclass;
        uint32 ecode;
        char *tdata;
+       char *tparam;
 
        *data_len = *param_len = 0;
 
@@ -413,13 +414,15 @@ BOOL cli_receive_nt_trans(struct cli_state *cli,
                DEBUG(0,("cli_receive_nt_trans: failed to enlarge buffer"));
                return False;
        }
-       else *data = tdata;
-       tdata = Realloc(*param,total_param);
-       if (!tdata) {
+       else
+               *data = tdata;
+       tparam = Realloc(*param,total_param);
+       if (!tparam) {
                DEBUG(0,("cli_receive_nt_trans: failed to enlarge buffer"));
                return False;
        }
-       else *param = tdata;
+       else
+               *param = tparam;
 
        while (1)  {
                this_data = SVAL(cli->inbuf,smb_ntr_DataCount);