-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 07/28/2010 04:07 PM, Dmitri Pal wrote:
Stephen Gallagher wrote:
>
> Patch 0001: Add sysdb_attrs_to_list() utility function
> This is a simple utility to grab the values of a particular attributes
> from a sysdb_attrs list.
>
I started looking at this one and got confused.
Why do you need the inner loop?
How "i" is used?
What is the difference between the passed in number of the attributes
and the "num" member of the structure?
If this is not a bug a comment might be helpful to explain what you are
trying to accomplish.
We're passed in an array of sysdb_attrs. Each attr in this list can have
any number of attributes (defined by the ->num member of the structure).
The outer loop iterates through the array of sysdb_attrs objects, and
the inner loop iterates through the attributes for each object,
searching for the matching one.
I do note, however, that I should be breaking once the attribute is
found, otherwise I'm not agreeing with my first comment (that it only
returns the first of a multi-value attribute) and it's possible that if
attr_name refers to a multi-value attribute it will corrupt memory :(
So thanks, I'll fix this (and comment it better).
- --
Stephen Gallagher
RHCE 804006346421761
Delivering value year after year.
Red Hat ranks #1 in value among software vendors.
http://www.redhat.com/promo/vendor/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: Using GnuPG with Fedora -
http://enigmail.mozdev.org/
iEYEARECAAYFAkxQkIkACgkQeiVVYja6o6O5hQCfQpFuyGVAuxbsMoj1XEXZ97k0
GKAAoJjoqKsLqL4TiADpDuiF7XvTZVpb
=t7ma
-----END PGP SIGNATURE-----