Bug 1243121 Comment 51 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

(In reply to :aceman from comment #41)
> Comment on attachment 9100331 [details] [diff] [review]
> clang-formatted: ldap-sign-compaldap-sign-compare.patch (with ber_len_t
> change, too)
> 
> Review of attachment 9100331 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: ldap/c-sdk/libraries/libldap/getvalues.c
> @@ +103,5 @@
> >    } else {
> >      rc = ber_scanf(&ber, "[v]", &vals);
> >    }
> >  
> > +  if (rc == (int)LBER_ERROR) {
> 
> rc is int, even though ber_scanf returns unsigned int (ber_tag_t).
> But before this, they stuff strcasecmp (an int) into rc.
> 
> I wonder which way to go here.

In the later patch I am going to  post, I decided to set ber_tag_t to "int" (!).
That was done quite recently (last week.)

But then , I have to change a function that returns the length of a string to return "int".
This is because such a function returns ((ber_tag_t) 0xFFFFFFFF), that is minus one, to be a value that signals it.

Oh well, the code sucks frankly.
(In reply to :aceman from comment #41)
> Comment on attachment 9100331 [details] [diff] [review]
> clang-formatted: ldap-sign-compaldap-sign-compare.patch (with ber_len_t
> change, too)
> 
> Review of attachment 9100331 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: ldap/c-sdk/libraries/libldap/getvalues.c
> @@ +103,5 @@
> >    } else {
> >      rc = ber_scanf(&ber, "[v]", &vals);
> >    }
> >  
> > +  if (rc == (int)LBER_ERROR) {
> 
> rc is int, even though ber_scanf returns unsigned int (ber_tag_t).
> But before this, they stuff strcasecmp (an int) into rc.
> 
> I wonder which way to go here.

In the later patch I am going to  post, I decided to set ber_tag_t to "int" (!).
That was done quite recently (last week.)

But then , I have to change a function that returns the length of a string to return "int".
This is because such a function returns ((ber_tag_t) 0xFFFFFFFF), that is minus one, to be a value that signals it's error.

Oh well, the code sucks frankly.

Back to Bug 1243121 Comment 51