CVS update: samba/source/lib

Andrew Bartlett abartlet at samba.org
Mon Jul 15 12:43:54 EST 2002


Simo Sorce wrote:
> 
> Date:   Sun Jul 14 15:21:39 2002
> Author: idra
> 
> Update of /data/cvs/samba/source/lib
> In directory va:/tmp/cvs-serv6718/lib
> 
> Modified Files:
>         util_str.c substitute.c
> Log Message:
> addedd new (t)alloc_sub_* functions
> they will get a const string and return a (t)alloced epanded one.
> also modified passdb/* stuff to use this one.

These look good, but I am a little worried about the realloc every
time.   Copying to a pstring is ugly, but I'm worried about the constand
Realloc() - this code gets called a *lot*.

Also, can you confirm this is intentional:

--- samba/source/lib/util_str.c 2002/07/09 23:59:46     1.53
+++ samba/source/lib/util_str.c 2002/07/14 22:21:39     1.54
@@ -762,7 +762,7 @@
                                return NULL;
                        }
                        string = t;
-                       s = t + (p - s);
+                       p = t + (p - s);
                }
                if (li != lp) {
                        memmove(p+li,p+lp,strlen(p+lp)+1);

I have no reason to beleive its correct/incorrect, but it looked out of
place.  I'm assuming this code already functioned, so what does this
change do?

Andrew Bartlett

-- 
Andrew Bartlett                                 abartlet at pcug.org.au
Manager, Authentication Subsystems, Samba Team  abartlet at samba.org
Student Network Administrator, Hawker College   abartlet at hawkerc.net
http://samba.org     http://build.samba.org     http://hawkerc.net




More information about the samba-cvs mailing list