Author: obnox
Date: 2007-07-01 00:09:20 +0000 (Sun, 01 Jul 2007)
New Revision: 23669

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=23669

Log:
Move a variable into the only block where it is used.


Modified:
   branches/SAMBA_3_0/source/lib/util_reg_api.c
   branches/SAMBA_3_0_26/source/lib/util_reg_api.c


Changeset:
Modified: branches/SAMBA_3_0/source/lib/util_reg_api.c
===================================================================
--- branches/SAMBA_3_0/source/lib/util_reg_api.c        2007-06-30 23:52:23 UTC 
(rev 23668)
+++ branches/SAMBA_3_0/source/lib/util_reg_api.c        2007-07-01 00:09:20 UTC 
(rev 23669)
@@ -51,7 +51,6 @@
                 */
 
                smb_ucs2_t *tmp;
-               uint32 num_ucs2 = length / 2;
 
                if (length == 1) {
                        /* win2k regedit gives us a string of 1 byte when
@@ -71,6 +70,7 @@
                        goto error;
                }
                else {
+                       uint32 num_ucs2 = length / 2;
                        if (!(tmp = SMB_MALLOC_ARRAY(smb_ucs2_t, num_ucs2+1))) {
                                err = WERR_NOMEM;
                                goto error;

Modified: branches/SAMBA_3_0_26/source/lib/util_reg_api.c
===================================================================
--- branches/SAMBA_3_0_26/source/lib/util_reg_api.c     2007-06-30 23:52:23 UTC 
(rev 23668)
+++ branches/SAMBA_3_0_26/source/lib/util_reg_api.c     2007-07-01 00:09:20 UTC 
(rev 23669)
@@ -51,7 +51,6 @@
                 */
 
                smb_ucs2_t *tmp;
-               uint32 num_ucs2 = length / 2;
 
                if (length == 1) {
                        /* win2k regedit gives us a string of 1 byte when
@@ -71,6 +70,7 @@
                        goto error;
                }
                else {
+                       uint32 num_ucs2 = length / 2;
                        if (!(tmp = SMB_MALLOC_ARRAY(smb_ucs2_t, num_ucs2+1))) {
                                err = WERR_NOMEM;
                                goto error;

Reply via email to